#9077 closed defect (fixed)
Transparency wrong for yuv420 -> rgba on altivec
Reported by: | pocock | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | swscale |
Version: | git-master | Keywords: | ppc altivec |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description
Summary of the bug:
How to reproduce:
ffmpeg -loglevel 48 -i VID_20150419_101911.mp4 -vframes 1 -pix_fmt rgba out.png ffmpeg version 7:4.3.1-5~bpo10+1 with patch from #5570 built on Debian 10 / ppc64le
Discussed in Blender bug tracker
https://developer.blender.org/T80912#1095862
Copy of input file:
https://dev-files.blender.org/file/data/zkoixegxcuagluo2dd33/PHID-FILE-solnqodzm6hk76h4ud2f/VID_20150419_101911.mp4
PNG / Screenshot of broken output:
https://dev-files.blender.org/file/data/2ubaxhcrkusf6udvddh6/PHID-FILE-7izlml2yionqysqn4gma/ffmpeg-out.png
Console output from the ffmpeg command above:
https://dev-files.blender.org/file/download/jhiqfzxxqxqbscaph4of/PHID-FILE-krwaflq6uba7t3qjler6/ffmpeg-test-1.txt
Change History (6)
comment:1 by , 4 years ago
Summary: | image not rendered, vertical bars missing → image not rendered correctly, vertical bars missing |
---|
comment:2 by , 4 years ago
Component: | undetermined → swscale |
---|---|
Keywords: | ppc added; cat removed |
Priority: | important → normal |
Reproduced by developer: | set |
Status: | new → open |
Summary: | image not rendered correctly, vertical bars missing → yuv420 -> rgb32 broken on altivec |
comment:3 by , 4 years ago
Keywords: | altivec added |
---|---|
Summary: | yuv420 -> rgb32 broken on altivec → Transparency wrong for yuv420 -> rgba on altivec |
The current behaviour (transparency broken) is also reproducible with 68363b6989f3355457af90f0c568ccbae9d4deb2 (the fix seems not to work correctly), the output was broken differently before, this brokenness was fixed since, likely #7124.
ffmpeg -f rawvideo -s 320x240 -i out.yuv -pix_fmt rgb32_1 -vframes 1 -y -f image2 out.sgi FFmpeg version git-68363b6, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: --enable-swscale --enable-gpl --cc=/opt/at12.0/bin/gcc -m32 libavutil 49.15. 0 / 49.15. 0 libavcodec 52.20. 0 / 52.20. 0 libavformat 52.30. 1 / 52.30. 1 libavdevice 52. 1. 0 / 52. 1. 0 libswscale 0. 7. 1 / 0. 7. 1 built on Jan 23 2021 15:48:35, gcc: 8.3.1 20190304 (Advance-Toolchain-at12.0) [revision 269374] Input #0, rawvideo, from 'out.yuv': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0.0: Video: rawvideo, yuv420p, 320x240, 25 tbr, 25 tbn, 25 tbc [swscaler @ 0x10be1d00]ALTIVEC: Color Space RGBA Output #0, image2, to 'out.sgi': Stream #0.0: Video: sgi, rgb32_1, 320x240, q=2-31, 200 kb/s, 90k tbn, 25 tbc Stream mapping: Stream #0.0 -> #0.0 Press [q] to stop encoding frame= 1 fps= 0 q=0.0 Lsize= -0kB time=0.04 bitrate= -4.4kbits/s video:66kB audio:0kB global headers:0kB muxing overhead -100.032543%
comment:4 by , 4 years ago
Feel free to test this change:
diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c index 58e480d..eb6b3d7 100644 --- a/libswscale/ppc/yuv2rgb_altivec.c +++ b/libswscale/ppc/yuv2rgb_altivec.c @@ -425,13 +425,13 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in, \ } #define out_abgr(a, b, c, ptr) \ - vec_mstrgb32(__typeof__(a), ((__typeof__(a)) { 255 }), c, b, a, ptr) + vec_mstrgb32(__typeof__(a), ((__typeof__(a)) { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }), c, b, a, ptr) #define out_bgra(a, b, c, ptr) \ - vec_mstrgb32(__typeof__(a), c, b, a, ((__typeof__(a)) { 255 }), ptr) + vec_mstrgb32(__typeof__(a), c, b, a, ((__typeof__(a)) { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }), ptr) #define out_rgba(a, b, c, ptr) \ - vec_mstrgb32(__typeof__(a), a, b, c, ((__typeof__(a)) { 255 }), ptr) + vec_mstrgb32(__typeof__(a), a, b, c, ((__typeof__(a)) { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }), ptr) #define out_argb(a, b, c, ptr) \ - vec_mstrgb32(__typeof__(a), ((__typeof__(a)) { 255 }), a, b, c, ptr) + vec_mstrgb32(__typeof__(a), ((__typeof__(a)) { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }), a, b, c, ptr) #define out_rgb24(a, b, c, ptr) vec_mstrgb24(a, b, c, ptr) #define out_bgr24(a, b, c, ptr) vec_mstbgr24(a, b, c, ptr)
comment:5 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
Should be fixed in 2687070d9b092d3a354a6963c65197054ddf7a75
comment:6 by , 4 years ago
I downloaded the commit as a patch, applied it on 4.3.1 and it fixed the problem for me. Thanks for fixing this so quickly.
Updated the details in the Blender bug too
https://developer.blender.org/T80912#1099699
For future tickets:
Please test current FFmpeg git head, the only version supported on this bug tracker and please always provide all information here on the bug tracker, do not use external resources except for large input files.
Workaround is to convert to rgb24.
Output is visually broken.
On Power6, Power7 etc. this is a regression since 8dcbfb73d58c06fa012db5ffea97647fed95a280