On Sat, Dec 06, 2008 at 03:01:00AM +0100, conrad wrote:
> Author: conrad
> Date: Sat Dec  6 03:00:59 2008
> New Revision: 3871
> 
> Log:
> Small optimization
> 
> 
> Modified:
>    dirac/libavcodec/diracdec.c
> 
> Modified: dirac/libavcodec/diracdec.c
> ==============================================================================
> --- dirac/libavcodec/diracdec.c       (original)
> +++ dirac/libavcodec/diracdec.c       Sat Dec  6 03:00:59 2008
> @@ -664,9 +664,9 @@ static int dirac_decode_frame_internal(D
>              mcline    = s->mcpic;
>              for (y = 0; y < height; y++) {
>                  for (x = 0; x < width; x++) {
> +                    int coeff = mcline[x] + (1 << (s->total_wt_bits - 1));
> +                    coeff = line[x] + (coeff >> s->total_wt_bits);
> +                    frame[x]= av_clip_uint8(coeff + 128);
>                  }

depending on how large total_wt_bits can be, the following might be possible

bias= 257 << (s->total_wt_bits - 1);
for (y = 0; y < height; y++) {
    for (x = 0; x < width; x++) {
        int coeff = mcline[x] + bias;
        coeff = line[x] + (coeff >> s->total_wt_bits);
        frame[x]= av_clip_uint8(coeff);
    }
}


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 

Attachment: signature.asc
Description: Digital signature

_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to