[Ffmpeg-devel] [PATCH] CYUV encoder resurrected

Baptiste Coudurier baptiste.coudurier
Sat Mar 3 01:44:19 CET 2007


Hi

Michael Niedermayer wrote:
> Hi
> 
> On Thu, Mar 01, 2007 at 01:45:26AM +0100, Baptiste Coudurier wrote:
>> Hi
>>
>> Here is old cyuv encoder resurrected from
>>
>> [Ffmpeg-devel] Trellis Quantization Applied To (A)DPCM
>> http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2006-June/011688.html
>>
>> by Loren.
>>
>> I added some #ifdef DEBUG around printf code, renamed some macros. Can
>> it be applied ?
> 
> [...]
>> +        u = nodes;
>> +        nodes = nodes_next;
>> +        nodes_next = u;
> 
> FFSWAP

Done

> [...]
>> +        for(i=0; i<16; i++){
>> +            int score = abs(d - table[i]);
> 
> FFABS
> 

Done

> [...]
>> +static int tables_tried = 0;
> 
> non constant static
> 

Removed

> [...]
> 
>> +        {
>> +            static int fn = 0;
>> +            dprintf("fn %d tables_tried %d \n", fn, tables_tried);
>> +            fn++;
>> +        }
> 

Removed.

> [...]
>> +            uint8_t y_buf[s->avctx->width];
>> +            uint8_t u_buf[s->avctx->width>>2];
>> +            uint8_t v_buf[s->avctx->width>>2];
>> +            pict->error[0] += quantize_row_trellis(avctx, y_ptr, y_buf, y_table, y_itable, s->avctx->width);
>> +            pict->error[1] += quantize_row_trellis(avctx, u_ptr, u_buf, u_table, u_itable, s->avctx->width>>2);
>> +            pict->error[2] += quantize_row_trellis(avctx, v_ptr, v_buf, v_table, v_itable, s->avctx->width>>2);
> 
> could be put into a loop maybe, the same applies to other similar YUV cases
> of course only if the resulting code is simpler
> 

I'll let Loren do it if he feels like it. Updated patch attached.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
SMARTJOG S.A.                                    http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
Phone: +33 1 49966312
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cyuv_encoder.patch
Type: text/x-diff
Size: 19791 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070303/bf21e134/attachment.patch>



More information about the ffmpeg-devel mailing list