Opened 12 years ago

Closed 9 years ago

Last modified 9 years ago

#2475 closed enhancement (fixed)

support yuv422p10le in lut filter

Reported by: dave rice Owned by:
Priority: wish Component: avfilter
Version: git-master Keywords: lut
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

I would like to use the lut filter with 10 bit video (encoded as v210), but it only supports 8 bit yuv pixel formats. In the example below the input is 10 bit, the filter's output is 8 bit, and then the output has zero-filled least significant bits (9 and 10). Could the lut filter support >8 bit formats? Thanks.

How to reproduce:

ffmpeg -i 10-bit_test.mov -vf lutyuv=u=128:v=128 -c:v v210 -c:a copy -y 10-bit-gray.mov
ffmpeg version 1.1.git Copyright (c) 2000-2013 the FFmpeg developers
  built on Apr 13 2013 10:04:18 with Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-ffplay --enable-libcaca
  libavutil      52. 26.100 / 52. 26.100
  libavcodec     55.  2.100 / 55.  2.100
  libavformat    55.  2.100 / 55.  2.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 53.101 /  3. 53.101
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '10-bit_test.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    creation_time   : 2009-08-22 23:16:59
  Duration: 00:00:10.20, start: 0.000000, bitrate: 225452 kb/s
    Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le, 720x486, 223724 kb/s, SAR 10:11 DAR 400:297, 29.97 fps, 29.97 tbr, 2997 tbn, 2997 tbc
    Metadata:
      creation_time   : 2009-08-22 23:16:59
      handler_name    : Apple Alias Data Handler
      timecode        : 01:45:54:18
    Stream #0:1(eng): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, stereo, s16, 1536 kb/s
    Metadata:
      creation_time   : 2009-08-22 23:16:59
      handler_name    : Apple Alias Data Handler
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74)
    Metadata:
      creation_time   : 2009-08-22 23:16:59
      handler_name    : Apple Alias Data Handler
      timecode        : 01:45:54:18
Output #0, mov, to '10-bit-gray.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 537199360
    compatible_brands: qt  
    encoder         : Lavf55.2.100
    Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le, 720x486 [SAR 10:11 DAR 400:297], q=2-31, 200 kb/s, 11988 tbn, 29.97 tbc
    Metadata:
      creation_time   : 2009-08-22 23:16:59
      handler_name    : Apple Alias Data Handler
      timecode        : 01:45:54:18
    Stream #0:1(eng): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, stereo, 1536 kb/s
    Metadata:
      creation_time   : 2009-08-22 23:16:59
      handler_name    : Apple Alias Data Handler
Stream mapping:
  Stream #0:0 -> #0:0 (v210 -> v210)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=  306 fps= 43 q=0.0 Lsize=  280763kB time=00:00:10.21 bitrate=225265.5kbits/s    
video:278842kB audio:1913kB subtitle:0 global headers:0kB muxing overhead 0.002646%

Change History (5)

comment:1 by Carl Eugen Hoyos, 12 years ago

Priority: normalwish
Status: newopen

comment:2 by kieranjol, 9 years ago

Hi,

Would be great if this could get implemented. I'm currently trying to analyse 10bit v210 video via qctools and only the first 8 bits make it through the filter.

comment:3 by dave rice, 9 years ago

For context, QCTools creates a bit plane filter via lutyuv with this filterchain:

lutyuv=\
y=bitand(val,pow(2,8-${what_bit_do_you_want}))*pow(2,${what_bit_do_you_want}:\
u=128:\
v=128

Feasibly the geq filter could do the same work; however both the lut and geq filter do not accept >8 bit formats. Ultimately we'd like a way to utilize the lower bits of >8 bit formats via the bitand function and either lut or geq.

Last edited 9 years ago by dave rice (previous) (diff)

comment:4 by Carl Eugen Hoyos, 9 years ago

Resolution: fixed
Status: openclosed

Implemented by Paul B Mahol in b74ebd09c719ad250de6e5cdf8fb5663cb0212c8

Note: See TracTickets for help on using tickets.