imc: use DSPContext.bswap16_buf() to byte-swap packet data
This commit is contained in:
		
							parent
							
								
									f011fcd67e
								
							
						
					
					
						commit
						e9362aaedf
					
				@ -655,14 +655,14 @@ static int imc_decode_frame(AVCodecContext * avctx,
 | 
				
			|||||||
    int flag;
 | 
					    int flag;
 | 
				
			||||||
    int bits, summer;
 | 
					    int bits, summer;
 | 
				
			||||||
    int counter, bitscount;
 | 
					    int counter, bitscount;
 | 
				
			||||||
    uint16_t buf16[IMC_BLOCK_SIZE / 2];
 | 
					    LOCAL_ALIGNED_16(uint16_t, buf16, [IMC_BLOCK_SIZE / 2]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (buf_size < IMC_BLOCK_SIZE) {
 | 
					    if (buf_size < IMC_BLOCK_SIZE) {
 | 
				
			||||||
        av_log(avctx, AV_LOG_ERROR, "imc frame too small!\n");
 | 
					        av_log(avctx, AV_LOG_ERROR, "imc frame too small!\n");
 | 
				
			||||||
        return -1;
 | 
					        return -1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    for(i = 0; i < IMC_BLOCK_SIZE / 2; i++)
 | 
					
 | 
				
			||||||
        buf16[i] = av_bswap16(((const uint16_t*)buf)[i]);
 | 
					    q->dsp.bswap16_buf(buf16, (const uint16_t*)buf, IMC_BLOCK_SIZE / 2);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    q->out_samples = data;
 | 
					    q->out_samples = data;
 | 
				
			||||||
    init_get_bits(&q->gb, (const uint8_t*)buf16, IMC_BLOCK_SIZE * 8);
 | 
					    init_get_bits(&q->gb, (const uint8_t*)buf16, IMC_BLOCK_SIZE * 8);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user