prores: use natural integer type for the codebook index
The operations that use it require it to be promoted to a larger (natural) type and thus perform sign extension on it. While an optimal compiler may account for this, gcc 4.6 (for x86 Windows) fails. Using the natural integer type provides a 2% speedup for Win64 and 1% for Win32. Signed-off-by: Diego Biurrun <diego@biurrun.de>
This commit is contained in:
		
							parent
							
								
									0ad522afb3
								
							
						
					
					
						commit
						b5696ff2b8
					
				@ -289,7 +289,7 @@ static int decode_picture_header(ProresContext *ctx, const uint8_t *buf,
 | 
			
		||||
/**
 | 
			
		||||
 * Read an unsigned rice/exp golomb codeword.
 | 
			
		||||
 */
 | 
			
		||||
static inline int decode_vlc_codeword(GetBitContext *gb, uint8_t codebook)
 | 
			
		||||
static inline int decode_vlc_codeword(GetBitContext *gb, unsigned codebook)
 | 
			
		||||
{
 | 
			
		||||
    unsigned int rice_order, exp_order, switch_bits;
 | 
			
		||||
    unsigned int buf, code;
 | 
			
		||||
 | 
			
		||||
@ -229,7 +229,7 @@ static void get_slice_data(ProresContext *ctx, const uint16_t *src,
 | 
			
		||||
/**
 | 
			
		||||
 * Write an unsigned rice/exp golomb codeword.
 | 
			
		||||
 */
 | 
			
		||||
static inline void encode_vlc_codeword(PutBitContext *pb, uint8_t codebook, int val)
 | 
			
		||||
static inline void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val)
 | 
			
		||||
{
 | 
			
		||||
    unsigned int rice_order, exp_order, switch_bits, switch_val;
 | 
			
		||||
    int exponent;
 | 
			
		||||
@ -393,7 +393,7 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic,
 | 
			
		||||
    return total_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline int estimate_vlc(uint8_t codebook, int val)
 | 
			
		||||
static inline int estimate_vlc(unsigned codebook, int val)
 | 
			
		||||
{
 | 
			
		||||
    unsigned int rice_order, exp_order, switch_bits, switch_val;
 | 
			
		||||
    int exponent;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user