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

Michael Niedermayer michaelni
Tue Jun 22 23:27:24 CEST 2010


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
i used i as varible for testing and dc as correct reference then
replaced i for the reply but being too scatterbrained forgot one :)


> 
> > or
> > dc= (dc*2047 + 8192)>>14;
> >
> >> +    for (y = 0; y < 8; y++, dst += line_size) {
> >> +        for (x = 0; x < 8; x++) {
> >> +            dst[x] = cm[dst[x] + dc];
> >> +        }
> >> +    }
> >
> > cm += dc;
> > can be done outside the loop
> 
> I noticed today this could be done in quite a few places throughout
> existing code.

please fix them


> 
> >> Index: libavcodec/h264.h
> >> ===================================================================
> >> --- libavcodec/h264.h	(revision 23459)
> >> +++ libavcodec/h264.h	(working copy)
> >> @@ -735,22 +735,6 @@
> >>   1+5*8, 2+5*8,
> >>  };
> >>  
> >> -static av_always_inline uint32_t pack16to32(int a, int b){
> >> -#if HAVE_BIGENDIAN
> >> -   return (b&0xFFFF) + (a<<16);
> >> -#else
> >> -   return (a&0xFFFF) + (b<<16);
> >> -#endif
> >> -}
> >> -
> >> -static av_always_inline uint16_t pack8to16(int a, int b){
> >> -#if HAVE_BIGENDIAN
> >> -   return (b&0xFF) + (a<<8);
> >> -#else
> >> -   return (a&0xFF) + (b<<8);
> >> -#endif
> >> -}
> >> -
> >
> > moving these or anything else to a common place is ok of course
> 
> I suggest alongside the 8x4 Ronald added today.

just keep track which of these work with negative numbers and which not

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Incandescent light bulbs waste a lot of energy as heat so the EU forbids them.
Their replacement, compact fluorescent lamps, much more expensive, dont fit in
many old lamps, flicker, contain toxic mercury, produce a fraction of the light
that is claimed and in a unnatural spectrum rendering colors different than
in natural light. Ah and we now need to turn the heaters up more in winter to
compensate the lower wasted heat. Who wins? Not the environment, thats for sure
-------------- 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-devel/attachments/20100622/9783d4a8/attachment.pgp>



More information about the ffmpeg-devel mailing list