[FFmpeg-devel] [PATCH] mpeg2: fix block_last_index when mismatch control modifies last coeff

Måns Rullgård mans
Wed Jun 23 00:08:41 CEST 2010


M?ns Rullg?rd <mans at mansr.com> writes:

> Michael Niedermayer <michaelni at gmx.at> writes:
>
>> On Tue, Jun 22, 2010 at 09:46:35PM +0100, M?ns Rullg?rd wrote:
>>> Michael Niedermayer <michaelni at gmx.at> writes:
>>> 
>>> >> +static inline void idct_dc_add(uint8_t *dst, int line_size, int dc)
>>> >> +{
>>> >> +    int x, y;
>>> >> +    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
>>> >
>>> >> +    dc = (16383 * dc + 1024) >> 11;
>>> >> +    dc = (16383 * (dc + 32)) >> 20;
>>> >
>>> > dc= (dc + (i<0) + 3)>>3;
>>> 
>>> i?
>>
>> i=dc
>
> OK.  This could compile to a branch with some back luck, ...

Unless written as dc = (int)(dc + ((unsigned)dc >> 31) + 3) >> 3
GCC does appear to be smart enough to do this though.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list