Opened 12 years ago

Closed 12 years ago

#904 closed defect (fixed)

yuv2rgb_mmx.c not allowing yuv422p

Reported by: Frankie Fong Owned by: Michael Niedermayer
Priority: important Component: swscale
Version: git-master Keywords: regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

I noticed that yuv2rgb_mmx.c is rejecting source formats of yuv422p. It does not have such restrictions in ffmpeg-0.6.4. And I looked at change 5aa70309 at yuv2rgb_template.c. And the macro YUV2RGB_LOOP seems to indicate yuv422p is supported.

Can someone clarify this?

I am asking this because the warning message "No accelerated conversion from yuv422p to bgr24" keep appearing during video playback.

Thanks!

Attachments (1)

yuvj422.jpg (18.7 KB ) - added by Carl Eugen Hoyos 12 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by Carl Eugen Hoyos, 12 years ago

If you believe this is a regression, please use git bisect to find the offending commit.

comment:2 by Frankie Fong, 12 years ago

Well, I am not familiar with git as I am not ffmpeg developer. I integrate ffmpeg to OpenCV. I use github investigate changes as it makes more sense to my situation. I don't know why github shows commit-id in hexadecimal string. But here is what I found confusing:

[ rejects yuv422p ]
libswscale/x86/yuv2rgb_mmx.c: e66149e714006d099d1ebfcca3f22ca74fc7dcf4

[ accommodates yuv422p ]
libswscale/x86/yuv2rgb_template.c: 5aa70309ad236cf7e218cdce913d8290aae04d4a

If you have any advice on the hexadecimal thing, let me know how I could get decimal value of this.

Thanks.

comment:3 by Carl Eugen Hoyos, 12 years ago

If you are unable to use git bisect (it is simple and works really, really well), please at least add some information to make this a pontentially reproducible problem report, including information such as what you are trying to achieve, what you are doing to achieve it and what goes wrong.

comment:4 by Frankie Fong, 12 years ago

Hi, I have posted information in the description or past comments. I thought my question is quite straightforward.
Could you give me some specifics on what you want to get more from me? It would certainly help.

I could show you the lines/changeset from github, it's quite straightforward - really, as a ffmpeg novice like me. It's obvious something is not quite right.

(line 46) https://github.com/FFmpeg/FFmpeg/blame/release/0.8/libswscale/x86/yuv2rgb_template.c

(line 71-72) https://github.com/FFmpeg/FFmpeg/blame/master/libswscale/x86/yuv2rgb_mmx.c

Thanks!

in reply to:  4 comment:5 by Carl Eugen Hoyos, 12 years ago

Replying to ffong:

Hi, I have posted information in the description or past comments. I thought my question is quite straightforward.
Could you give me some specifics on what you want to get more from me? It would certainly help.

Please start with a ffmpeg command line, adding complete, uncut console output and a sample if necessary and explaining what goes wrong.

Is this a duplicate of ticket #143?
Related to http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/131430

comment:6 by Frankie Fong, 12 years ago

The whole thing is very simple. Converting yuv422p to bgr24 on Intel with MMX would give warnings "No accelerated conversion from yuv422p to bgr24". It's expected from the current code at ffmpeg-0.8.9 release. But what I don't understand is, if it is not supporting yuv422p. How come there is a recent change to yuv2rgb_template.c that checks for yuv422p? I modified the code to allow yuv422p and it seems to do OK. Maybe some loss in chroma sampling but in general does not crash or anything. So I wonder if the rejection of yuv422p at libswscale/x86/yuv2rgb_mmx.c is necessary.

Here is the console output.
$ ../install-0.8.9/bin/ffmpeg.exe -i ../Huff_Conv2YUV.avi -pix_fmt bgr24 -f ima
ge2 '%03d.bmp' -t 5
ffmpeg version 0.8.9, Copyright (c) 2000-2011 the FFmpeg developers

built on Jan 10 2012 20:56:05 with gcc 4.6.1
configuration: --prefix=/home/Frankie/ffmpeg-0.8.9/../install-0.8.9/ --enable-

gpl --enable-version3 --arch=x86 --enable-runtime-cpudetect --enable-w32threads
--enable-memalign-hack --disable-avfilter --disable-postproc

libavutil 51. 9. 1 / 51. 9. 1
libavcodec 53. 8. 0 / 53. 8. 0
libavformat 53. 5. 0 / 53. 5. 0
libavdevice 53. 1. 1 / 53. 1. 1
libswscale 2. 0. 0 / 2. 0. 0

Input #0, avi, from '../Huff_Conv2YUV.avi':

Duration: 00:00:23.00, start: 0.000000, bitrate: 65081 kb/s

Stream #0.0: Video: huffyuv, yuv422p, 704x576, 25 tbr, 25 tbn, 25 tbc

Output #0, image2, to '%03d.bmp':

Metadata:

encoder : Lavf53.5.0
Stream #0.0: Video: bmp, bgr24, 704x576, q=2-31, 200 kb/s, 90k tbn, 25 tbc

Stream mapping:

Stream #0.0 -> #0.0

Press [q] to stop, ? for help
[swscaler @ 0161b000] No accelerated colorspace conversion found from yuv422p to

bgr24.

frame= 29 fps= 0 q=0.0 size= -0kB time=00:00:01.16 bitrate= -0.2kbits/s
frame= 35 fps= 29 q=0.0 size= -0kB time=00:00:01.40 bitrate= -0.1kbits/s
frame= 38 fps= 15 q=0.0 size= -0kB time=00:00:01.52 bitrate= -0.1kbits/s
frame= 40 fps= 12 q=0.0 size= -0kB time=00:00:01.60 bitrate= -0.1kbits/s
frame= 43 fps= 11 q=0.0 size= -0kB time=00:00:01.72 bitrate= -0.1kbits/s
frame= 53 fps= 12 q=0.0 size= -0kB time=00:00:02.12 bitrate= -0.1kbits/s
frame= 60 fps= 12 q=0.0 size= -0kB time=00:00:02.40 bitrate= -0.1kbits/s
frame= 65 fps= 12 q=0.0 size= -0kB time=00:00:02.60 bitrate= -0.1kbits/s
frame= 71 fps= 12 q=0.0 size= -0kB time=00:00:02.84 bitrate= -0.1kbits/s
frame= 75 fps= 11 q=0.0 size= -0kB time=00:00:03.00 bitrate= -0.1kbits/s
frame= 80 fps= 11 q=0.0 size= -0kB time=00:00:03.20 bitrate= -0.1kbits/s
frame= 86 fps= 11 q=0.0 size= -0kB time=00:00:03.44 bitrate= -0.1kbits/s
frame= 91 fps= 11 q=0.0 size= -0kB time=00:00:03.64 bitrate= -0.0kbits/s
frame= 95 fps= 11 q=0.0 size= -0kB time=00:00:03.80 bitrate= -0.0kbits/s
frame= 101 fps= 11 q=0.0 size= -0kB time=00:00:04.04 bitrate= -0.0kbits/s
frame= 105 fps= 10 q=0.0 size= -0kB time=00:00:04.20 bitrate= -0.0kbits/s
frame= 110 fps= 10 q=0.0 size= -0kB time=00:00:04.40 bitrate= -0.0kbits/s
frame= 116 fps= 10 q=0.0 size= -0kB time=00:00:04.64 bitrate= -0.0kbits/s
frame= 120 fps= 10 q=0.0 size= -0kB time=00:00:04.80 bitrate= -0.0kbits/s
frame= 125 fps= 10 q=0.0 Lsize= -0kB time=00:00:05.00 bitrate= -0.0kbits/
s
video:148507kB audio:0kB global headers:0kB muxing overhead -100.000014%

comment:7 by Carl Eugen Hoyos, 12 years ago

Keywords: regression added
Priority: normalimportant
Reproduced by developer: set
Status: newopen
Version: 0.8.9git-master

Possibly a regression since e66149e7

For future bug reports:
Please always test current git head and please provide a sample if necessary.

by Carl Eugen Hoyos, 12 years ago

Attachment: yuvj422.jpg added

comment:8 by Carl Eugen Hoyos, 12 years ago

$ ffmpeg -i yuvj422.jpg out.bmp
ffmpeg version N-36659-g2169f97 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jan 10 2012 15:33:43 with gcc 4.5.3
  configuration: --cc='/usr/local/gcc-4.5.3/bin/gcc -m32'
  libavutil      51. 34.100 / 51. 34.100
  libavcodec     53. 54.100 / 53. 54.100
  libavformat    53. 29.100 / 53. 29.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 58.100 /  2. 58.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
Input #0, image2, from 'yuvj422.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj422p, 720x576, 25 tbr, 25 tbn, 25 tbc
Incompatible pixel format 'yuvj422p' for codec 'bmp', auto-selecting format 'bgr24'
[buffer @ 0x8dd8000] w:720 h:576 pixfmt:yuvj422p tb:1/1000000 sar:0/1 sws_param:
[buffersink @ 0x8dd8d20] auto-inserting filter 'auto-inserted scale 0' between the filter 'src' and the filter 'out'
[scale @ 0x8dd9240] w:720 h:576 fmt:yuvj422p -> w:720 h:576 fmt:bgr24 flags:0x4
[swscaler @ 0x8de4280] No accelerated colorspace conversion found from yuv422p to bgr24.
[swscaler @ 0x8dee060] No accelerated colorspace conversion found from yuv422p to bgr24.
[swscaler @ 0x8df2b00] No accelerated colorspace conversion found from yuv422p to bgr24.
Output #0, image2, to 'out.bmp':
  Metadata:
    encoder         : Lavf53.29.100
    Stream #0:0: Video: bmp, bgr24, 720x576, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg -> bmp)
Press [q] to stop, [?] for help
frame=    1 fps=  0 q=0.0 Lsize=       0kB time=00:00:00.04 bitrate=   0.0kbits/s
video:1215kB audio:0kB global headers:0kB muxing overhead -100.000000%

comment:9 by Carl Eugen Hoyos, 12 years ago

Resolution: fixed
Status: openclosed

Fixed by Michael, thank you for the report!

Note: See TracTickets for help on using tickets.