Googles appar
Huvudmeny

Post a Comment On: cbloom rants

"10-14-10 - Image Comparison Part 2"

4 Comments -

1 – 4 of 4
Blogger ryg said...

"I think ffmpeg/x264 use "broadcast standard" YUV in the 16-235 range instead of 0-255 , so that might be a large piece of the problem."
Btw, what type of chroma subsampling do you use for JPEG/NewDCT? I'm not sure whether the IJG code defaults to 2:1 chroma subsampling in both horizontal or vertical direction, or just 2:1 horizontal with no vertical subsampling. The latter would make a big difference.

.y4m looks straightforward enough, can't you just write it out yourself using the JPEG color transform and a decent downsampler, and similarly have the video decoder output to .y4m and do the chroma upsampling/YCbCr->RGB yourself? That would get rid of a lot of possible problems.

October 15, 2010 at 9:55 PM

Blogger cbloom said...

"Btw, what type of chroma subsampling do you use for JPEG/NewDCT?"

They both use 2x2 chroma subsampling, so-called "420"


".y4m looks straightforward enough, can't you just write it out yourself using the JPEG color transform and a decent downsampler, and similarly have the video decoder output to .y4m and do the chroma upsampling/YCbCr->RGB yourself? That would get rid of a lot of possible problems."

Yeah, I've been thinking about that for a while, but it's rather a lot of work just to test someone else's compressor.

I wish there was a standard float image format, because then we could separate the color transform part from the plane coding. There could be a driver that does the color convert and assigns a number of bits to each plane, and then you just run a gray scale plane coder on each one. It would make comparison much easier. But it has to be a float image format. And of course that presupposes that your only handling of color is in the transform, which is woefully primitive.

October 16, 2010 at 12:45 AM

Blogger cbloom said...

BTW NewDCT downsamples with the 6-tap filter described here :

http://cbloomrants.blogspot.com/2009/06/06-17-09-inverse-box-sampling-part-2.html

October 16, 2010 at 12:06 PM

Blogger cbloom said...

I've discovered there *is* a YUVJ in ffmpeg :

http://ffmpeg.org/doxygen/0.5/pixfmt_8h.html

however it doesn't seem to be actually supported by anything.

the Y4M output pipe refuses to take it, and so does libx264

.. apparently yuvj is deprecated, you're supposed to use YUV420 and set AVCOL-RANGE-JPEG somehow, but I can't figure out how to set that.

I think I've figured out how to make them do the up/down sample correctly. You specify :

-sws_flags +bicubic+accurate_rnd+full_chroma_int


Not sure if full_chroma_inp is also helpful

October 16, 2010 at 1:33 PM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.