Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#417 closed defect (fixed)

correct grayscale palette for 2/4bpp TIFF

Reported by: ami_stuff Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: tif
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

maybe this code should be modified in libavcodec/tiff.c to support properly 2/4bpp grayscales:

            /* make default grayscale pal */
            pal = (uint32_t *) s->picture.data[1];
            for (i = 0; i < 256; i++)
                pal[i] = i * 0x010101;
C:\>ffmpeg -i C:\TIFF_2bpp_grayscale.mov
ffmpeg version N-32077-g5f5e37e, Copyright (c) 2000-2011 the FFmpeg developers
  built on Aug 24 2011 02:29:36 with gcc 4.5.0 20100414 (Fedora MinGW 4.5.0-1.fc
14)
  configuration: --prefix=/var/www/users/research/ffmpeg/snapshots/build --arch=
x86 --target-os=mingw32 --cross-prefix=i686-pc-mingw32- --cc='ccache i686-pc-min
gw32-gcc' --enable-w32threads --enable-memalign-hack --enable-runtime-cpudetect
--enable-cross-compile --enable-static --disable-shared --extra-libs='-lws2_32 -
lwinmm' --extra-cflags='--static -I/var/www/users/research/ffmpeg/snapshots/buil
d/include' --extra-ldflags='-static -L/var/www/users/research/ffmpeg/snapshots/b
uild/lib' --enable-bzlib --enable-zlib --enable-gpl --enable-version3 --enable-n
onfree --enable-libx264 --enable-libspeex --enable-libtheora --enable-libvorbis
--enable-libfaac --enable-libxvid --enable-libopencore-amrnb --enable-libopencor
e-amrwb --enable-libmp3lame --enable-libvpx --disable-decoder=libvpx
  libavutil    51. 13. 0 / 51. 13. 0
  libavcodec   53. 12. 0 / 53. 12. 0
  libavformat  53.  9. 0 / 53.  9. 0
  libavdevice  53.  3. 0 / 53.  3. 0
  libavfilter   2. 34. 2 /  2. 34. 2
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\TIFF_2bpp_grayscale.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2011-08-24 18:55:16
  Duration: 00:00:00.33, start: 0.000000, bitrate: 9279 kb/s
    Stream #0.0(eng): Video: tiff (tiff / 0x66666974), pal8, 640x480, 9258 kb/s,
 15 fps, 15 tbr, 15 tbn, 15 tbc
    Metadata:
      creation_time   : 2011-08-24 18:55:16
At least one output file must be specified
C:\>ffmpeg -i C:\TIFF_4bpp_grayscale.mov
ffmpeg version N-32077-g5f5e37e, Copyright (c) 2000-2011 the FFmpeg developers
  built on Aug 24 2011 02:29:36 with gcc 4.5.0 20100414 (Fedora MinGW 4.5.0-1.fc
14)
  configuration: --prefix=/var/www/users/research/ffmpeg/snapshots/build --arch=
x86 --target-os=mingw32 --cross-prefix=i686-pc-mingw32- --cc='ccache i686-pc-min
gw32-gcc' --enable-w32threads --enable-memalign-hack --enable-runtime-cpudetect
--enable-cross-compile --enable-static --disable-shared --extra-libs='-lws2_32 -
lwinmm' --extra-cflags='--static -I/var/www/users/research/ffmpeg/snapshots/buil
d/include' --extra-ldflags='-static -L/var/www/users/research/ffmpeg/snapshots/b
uild/lib' --enable-bzlib --enable-zlib --enable-gpl --enable-version3 --enable-n
onfree --enable-libx264 --enable-libspeex --enable-libtheora --enable-libvorbis
--enable-libfaac --enable-libxvid --enable-libopencore-amrnb --enable-libopencor
e-amrwb --enable-libmp3lame --enable-libvpx --disable-decoder=libvpx
  libavutil    51. 13. 0 / 51. 13. 0
  libavcodec   53. 12. 0 / 53. 12. 0
  libavformat  53.  9. 0 / 53.  9. 0
  libavdevice  53.  3. 0 / 53.  3. 0
  libavfilter   2. 34. 2 /  2. 34. 2
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\TIFF_4bpp_grayscale.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    creation_time   : 2011-08-24 18:57:01
  Duration: 00:00:00.33, start: 0.000000, bitrate: 18504 kb/s
    Stream #0.0(eng): Video: tiff (tiff / 0x66666974), pal8, 640x480, 18484 kb/s
, 15 fps, 15 tbr, 15 tbn, 15 tbc
    Metadata:
      creation_time   : 2011-08-24 18:57:01
At least one output file must be specified

Attachments (2)

TIFF_2bpp_grayscale.mov (377.6 KB ) - added by ami_stuff 13 years ago.
TIFF_4bpp_grayscale.mov (753.0 KB ) - added by ami_stuff 13 years ago.

Download all attachments as: .zip

Change History (5)

by ami_stuff, 13 years ago

Attachment: TIFF_2bpp_grayscale.mov added

by ami_stuff, 13 years ago

Attachment: TIFF_4bpp_grayscale.mov added

comment:1 by Carl Eugen Hoyos, 13 years ago

Component: undeterminedavcodec
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master

comment:2 by Carl Eugen Hoyos, 13 years ago

Resolution: fixed
Status: openclosed

comment:3 by Carl Eugen Hoyos, 13 years ago

Keywords: tif added
Note: See TracTickets for help on using tickets.