Log in

View Full Version : Disabling of 2x2 chroma blocking in MPEG-4 AVC?


molecool
7th May 2006, 02:54
Okay, what I got is some content that needs to be encoded into AVC. So far so good, but there is certain chroma detail in the content which cannot be averaged, otherwise it won't play correctly for my specialized application. I've done some test encodings and immediately realized that MPEG-4 and AVC all use YV12 (http://www.avisynth.org/mediawiki/wiki/YV12_FAQ) encoding, which does 2x2 chroma averaging by default. So does that mean I'm SOL here? Is there a way to disable this and 'somehow' retain the chroma detail? I vaguely remember that this was possible in MPEG-2 where 1x1 block detail could be chosen. Anyway, any suggestions would be very very welcome.

Thanks,

Molecool

foxyshadis
7th May 2006, 04:11
Pretty much you'd have to write a new YV24 backend for it. It's certainly possible though - I think Elecard or Ateme can do it, though I don't think Nero's version does. (Nero's aimed at dvd backup anyway, DVDs are all YV12.)

Actually, I just checked and Elecard and Ateme are also YV12, so I wonder how you could even get a YV24 or YUY2 AVC encode...

Manao
7th May 2006, 05:26
Libavcodec is trying to implement a 422 & 444 mpeg2 encoder. That's the only "mpeg" open source encoder that I know of that would handle something else than 420.

On a side note, implementing it in x264 only requires a motivated person, not necessarily well versed into video coding ( but who knows how to code ).

But of course, you'd also need to implement it in the decoder, because I don't know either a 422 or 444 decoder...

Edit : but what exactly requires such chroma precision ?

molecool
7th May 2006, 06:10
Edit : but what exactly requires such chroma precision ?

Well, it's a special video file needed to achieve an optical effect in an experimental setup. I actually found some info (http://forum.doom9.org/showthread.php?t=96059)on AVC High, which features 4:4:4 chroma encoding, but it really doesn't make any difference since the hardware we're running this on only supports AVC standard/main profile. This is a big problem... wished there was a work-around.

Sergey A. Sablin
7th May 2006, 07:47
But of course, you'd also need to implement it in the decoder, because I don't know either a 422 or 444 decoder...

I know at least 3 decoders supporting 422 subsampling one of which should be available through Intel UML. 444 is just awaitng for high444 profile completion.

berrinam
7th May 2006, 07:48
Double the resolution of the whole thing, so you get the entire chroma, (and redundant luma)

molecool
7th May 2006, 08:37
Double the resolution of the whole thing, so you get the entire chroma, (and redundant luma)

That's a pretty frakkin' smart idea - not sure the hardware I'm playing this on supports this, but kudos for 'out of the box thinking' :-)

Manao
7th May 2006, 10:12
I was going to suggest that idea, but I considered that original resolution in mpeg2 444 might yield better results. That, and the fact that 1440x1152 might be a bit hard on the hardware, especially since quality seems to be an issue, and that 1440x1152 high bitrate in AVC aren't easily decoded.

molecool
7th May 2006, 18:51
I was going to suggest that idea, but I considered that original resolution in mpeg2 444 might yield better results. That, and the fact that 1440x1152 might be a bit hard on the hardware, especially since quality seems to be an issue, and that 1440x1152 high bitrate in AVC aren't easily decoded.

I looked around for mpeg2 444 encoders yesterday - couldn't find much. Do you know a free encoder that allows 444? TMPGEnc sure doesn't...

Manao
7th May 2006, 19:00
As I said, libavcodec ( ffmpeg ) is working on an implementation. I don't remember how far they got though, since reports on the mailing list are rather terse.

guada 2
7th May 2006, 19:56
Manao,

did the speed change?
did the decoder compatible with it ?

Manao
7th May 2006, 20:02
The mpeg2 decoder in libavcodec has supported 422 and 444 for a long time now. The encoder, however, is another story ( cf previous post ). libmpeg2 also supports 422 and 444 for decoding.

molecool
7th May 2006, 20:41
The mpeg2 decoder in libavcodec has supported 422 and 444 for a long time now. The encoder, however, is another story ( cf previous post ). libmpeg2 also supports 422 and 444 for decoding.

How about Etymonix MPEG2 encoder? It's commercial, but seems to support 444. However, the description on their site claims that it is based on the standard Video for Windows (VfW) architecture. I'm not familiar with VfW - what are the implications?

Manao
7th May 2006, 20:54
Most probably that it doesn't handle bframes ( that's complete guessing ). I find it odd to do a mpeg2 encoder with the vfw framework. Anyway, it shouldn't cause any issue concerning the colorspace.

molecool
7th May 2006, 20:58
Most probably that it doesn't handle bframes ( that's complete guessing ). I find it odd to do a mpeg2 encoder with the vfw framework. Anyway, it shouldn't cause any issue concerning the colorspace.

I was more referring to me being able to play it. I assume VfW will only play on Window$ - how about Linux, Mac, etc/

DeathTheSheep
7th May 2006, 21:04
VFW implies VirtualDub (to encode/edit) and the AVI container. Such files play everywhere, even on standalones (the AVI container is pretty widespread after all)--otherwise, XviD decoding would be limited to Windows, which it clearly isn't. libavcodec, I believe, supports decoding MPEG2 directly from AVI.

molecool
7th May 2006, 21:50
VFW implies VirtualDub (to encode/edit) and the AVI container.

Just encoded it with Etymonix and it does play quite nicely in VirtualDub, but not in BSPlayer or WMP. Also, I have my doubts that this file would play outside my Etymonix codec environment.

Manao
7th May 2006, 21:53
Did you get an avi file or something else ? Anyway, install ffdshow, and configure it to decode mpeg2 ( and mpeg2 in avi in the same time ), it should help.

Btw, DeathTheSheep, vfw doesn't necessary imply VirtualDub nor the avi container.

DeathTheSheep
7th May 2006, 22:21
Manao: yeah, I was just doin' some generalizin' ;)

molecool: Try installing ffdshow and enabling "MPEG in AVI" in the directshow decoder settings. Then WMP and BSplayer will work just fine ;) ...probably. If it still doesn't work, the fourcc may not be supported, and you'll have to change it to "MPG2" with a FourCC changer.

molecool
8th May 2006, 05:39
Thanks for all the tips/pointers, guys - you rule! :D