[FFmpeg-soc] [soc]: r3871 - dirac/libavcodec/diracdec.c
Michael Niedermayer
michaelni at gmx.at
Sat Dec 6 12:21:32 CET 2008
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20081206/c24b9d2b/attachment.pgp>
More information about the FFmpeg-soc
mailing list