From: Keith W. <ke...@mi...> - 2011-08-04 04:52:18
|
Hi pebble, I'm not sure exactly where you're getting the [0, 32768] (the DC component can be negative), but I think you may probably barking up the wrong tree. IEEE 1180 only defines the IDCT statistically, so different MPEG-2 decoders can produce slightly different output. libmpeg2 may even produce slightly different output depending on whether you're using the C IDCT, MMX, SSE2, etc. The precision is probably not the issue; both libmpeg2 and the reference decoder use the precision specified in the coded bitstream for each component. You might find that switching the IDCT in use (look at mpeg2_idct_init() in idct.c, or modify cpu_accel.c) gives you something closer to the results of the reference decoder. In the end, though, these are all conforming decoders. Trying to get one to match the other _exactly_ may require swapping out one IDCT for another and tracking exactly where the divergence occurs. Good luck! Best, Keith On Wed, Aug 3, 2011 at 11:03 PM, pebble <sod...@ya...> wrote: > > Hi there, > > I need to hook into libmpeg2 so that I may do some processing on mpeg2 bitstream level. I have a working algorithm developed with the reference decoder (mssg's mpeg2v12.zip), but I would like to try on libmpeg2 because of its very fast decoding speed. > > To decode the same mpeg2 video file, I have tried the reference decoder and libmpeg2's mpegdec. I found that both decoders have produced nonidentical frames (a few pixels at various position gets different values). Furthermore, by checking the IDCT process, I found that, for Intra block, DC value in DCT coefficient matrix, the reference decoder (getpic.c) is using signed 11 bits [-1024, +1024] but libmpeg2 (slice.c) is using unsigned 15 bits [0, 32768]. > > I thought this could be one of the reasons why the decoded frames are nonidentical. > > Why libmpeg2 needs to use a larger bit size ? Is there any way to configure libmpeg2 to use signed 11 bits for Intra block DC value, so that its behavior could become a bit closer to that of reference decoder? > > Thanks. > > Best Regards, > > pebble > > ------------------------------------------------------------------------------ > BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA > The must-attend event for mobile developers. Connect with experts. > Get tools for creating Super Apps. See the latest technologies. > Sessions, hands-on labs, demos & much more. Register early & save! > http://p.sf.net/sfu/rim-blackberry-1 > _______________________________________________ > Libmpeg2-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libmpeg2-devel > |