[FFmpeg-trac] #3345(swscale:new): Bias in planar YUV to YUV bit depth conversion

FFmpeg trac at avcodec.org
Sat Jan 25 01:17:30 CET 2014


#3345: Bias in planar YUV to YUV bit depth conversion
---------------------------------+--------------------------------------
             Reporter:  abc123   |                     Type:  defect
               Status:  new      |                 Priority:  normal
            Component:  swscale  |                  Version:  git-master
             Keywords:           |               Blocked By:
             Blocking:           |  Reproduced by developer:  0
Analyzed by developer:  0        |
---------------------------------+--------------------------------------
 Summary of the bug: Unscaled YUV to YUV conversion
 (swscale_unscaled.c:planarCopyWrapper) produces output with a bias of
 -0.375 compared to the ideal real number result. We compare the ffmpeg
 output to the equation round(x / 4.0) which maps limited-range ITU-R 709
 10-bit (64-940 Y, 64-960 UV) to 8-bit (16-235 Y, 16-240 UV).

 How to reproduce:
 {{{
 % ffmpeg -pix_fmt yuv420p10le -s 1280x720 -i testGrad_01.yuv -pix_fmt
 yuv420p -f rawvideo testGrad_02.yuv
 ffmpeg version N-59852-g785dc14 Copyright (c) 2000-2014 the FFmpeg
 developers
   built on Jan 14 2014 22:07:30 with gcc 4.8.2 (GCC)
   configuration: --enable-gpl --enable-version3 --disable-w32threads
 --enable-avisynth --enable-bzlib --enable-fontconfi
 g --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-
 libbluray --enable-libcaca --enable-libfreetyp
 e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
 --enable-libopencore-amrnb --enable-libopenco
 re-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-
 libschroedinger --enable-libsoxr --enable-libsp
 eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-
 libvo-aacenc --enable-libvo-amrwbenc --enable-li
 bvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-
 libxavs --enable-libxvid --enable-zlib
   libavutil      52. 62.100 / 52. 62.100
   libavcodec     55. 48.101 / 55. 48.101
   libavformat    55. 23.103 / 55. 23.103
   libavdevice    55.  5.102 / 55.  5.102
   libavfilter     4.  1.100 /  4.  1.100
   libswscale      2.  5.101 /  2.  5.101
   libswresample   0. 17.104 /  0. 17.104
   libpostproc    52.  3.100 / 52.  3.100
 [rawvideo @ 0000000000338080] Estimating duration from bitrate, this may
 be inaccurate
 Input #0, rawvideo, from 'testGrad_01.yuv':
   Duration: 00:00:00.04, start: 0.000000, bitrate: 552960 kb/s
     Stream #0:0: Video: rawvideo (Y3[11][10] / 0xA0B3359), yuv420p10le,
 1280x720, 552960 kb/s, 25 tbr, 25 tbn, 25 tbc
 File 'testGrad_02.yuv' already exists. Overwrite ? [y/N] y
 Output #0, rawvideo, to 'testGrad_02.yuv':
   Metadata:
     encoder         : Lavf55.23.103
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720,
 q=2-31, 200 kb/s, 90k tbn, 25 tbc
 Stream mapping:
   Stream #0:0 -> #0:0 (rawvideo -> rawvideo)
 Press [q] to stop, [?] for help
 frame=    1 fps=0.0 q=0.0 Lsize=    1350kB time=00:00:00.04
 bitrate=276480.0kbits/s
 video:1350kB audio:0kB subtitle:0 global headers:0kB muxing overhead
 0.000000%
 }}}
 Patches should be submitted to the ffmpeg-devel mailing list and not this
 bug tracker.

 An example gradient (1280x720, 10-bit, 4:2:0) is attached to this ticket.
 We can pay a bounty for a fix to this problem.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/3345>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list