#2394 closed defect (fixed)
BGRA downscaling shifts colors
| Reported by: | Cigaes | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | swscale |
| Version: | git-master | Keywords: | bgra |
| Cc: | Blocked By: | ||
| Blocking: | Reproduced by developer: | yes | |
| Analyzed by developer: | no |
Description
Downscaling in BGRA produce a color shift.
How to reproduce:
./ffmpeg_g -lavfi color=c=blue:s=256x256,format=bgra,scale=4:4 \ -vframes 1 -f rawvideo - | xxd
ffmpeg version N-51202-gf8217da Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 21 2013 20:43:35 with gcc 4.7 (Debian 4.7.2-5)
configuration: --enable-shared --disable-static --enable-gpl --enable-libx264 --enable-libass --enable-libfreetype --enable-libopus --assert-level=2
libavutil 52. 22.100 / 52. 22.100
libavcodec 55. 1.100 / 55. 1.100
libavformat 55. 0.100 / 55. 0.100
libavdevice 55. 0.100 / 55. 0.100
libavfilter 3. 48.100 / 3. 48.100
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Output #0, rawvideo, to 'pipe:':
Metadata:
encoder : Lavf55.0.100
Stream #0:0: Video: rawvideo (BGRA / 0x41524742), bgra, 4x4 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
scale -> Stream #0:0 (rawvideo)
Press [q] to stop, [?] for help
frame= 1 fps=0.0 q=0.0 Lsize= 0kB time=00:00:00.04 bitrate= 12.8kbits/s
video:0kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.000000%
0000000: ed00 00f6 ed00 00f6 ed00 00f6 ed00 00f6 ................
0000010: e700 00f4 e700 00f4 e700 00f4 e700 00f4 ................
0000020: fd00 00ff fd00 00ff fd00 00ff fd00 00ff ................
0000030: fd00 00ff fd00 00ff fd00 00ff fd00 00ff ................
The same thing with RGBA instead of BGRA produces uniform 0000 fdff, which seems correct.
The phenomenon increases with the downscaling factor. The output size, OTOH, does not matter much. Only the last two lines are exempt.
Change History (6)
comment:1 by , 13 years ago
follow-up: 3 comment:2 by , 13 years ago
| Reproduced by developer: | set |
|---|---|
| Status: | new → open |
| Summary: | BGRA downscaling shift colors → BGRA downscaling shifts colors |
Also reproducible with 0.6 with the following command(s):
$ ffmpeg -lavfi color=c=blue:s=128x128,format=bgra -f rawvideo bgra.raw
$ ffmpeg -lavfi color=c=blue:s=128x128,format=rgba -f rawvideo rgba.raw
$ ffmpeg06 -f rawvideo -pix_fmt bgra -s 128x128 -i bgra.raw -s 8x8 -f rawvideo - | xxd
$ ffmpeg06 -f rawvideo -pix_fmt rgba -s 128x128 -i rgba.raw -s 8x8 -f rawvideo - | xxd
Reproducible with --disable-mmxext, not reproducible with --disable-mmx (-cpuflags -mmx crashes here).
comment:3 by , 13 years ago
Replying to cehoyos:
Reproducible with --disable-mmxext, not reproducible with --disable-mmx (-cpuflags -mmx crashes here).
-cpuflags -mmx
removes mmx but not later flags like mmx2 / sse, this combination doesnt exist in actual hardware CPUs and is thus poorly supported. If someone wants to fix all such crashes i dont mind but it has little practical use
comment:4 by , 11 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | open → closed |
cant reproduce anymore, so i assume this has probably been fixed
please reopen if its still reproduceabel for you
comment:5 by , 11 years ago
Not reproducible since a830915b78e2d96f08dc93b2d1c4330448b83ffd - see ticket #3028
comment:6 by , 11 years ago
| Resolution: | worksforme → fixed |
|---|



Extra info:
--disable-asmmakes the problem go away. Config differences when asm is enabled: