Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th December 2009, 05:53   #1  |  Link
OvejaNegra
ekTOMBE STUDIOS
 
OvejaNegra's Avatar
 
Join Date: Dec 2005
Location: Cuba
Posts: 253
non mod 16 cropping or black bars : which is worst and why?

As the title says.
i know the ideal is crop black bars and leave the frame on mod 16 size.
But some times is not possible without cropping image.
Well i DONT want crop the image.

Sometimes that can't be done without breaking one of these two rules:

A) crop black bars and leave a non mod 16 picture (some times the picture has tiny little bars of 2 or 3 pixels on the sides or up and down).

B) Leave the black bars (rarely those black bars are mod 16 width).

I know both choises are not reccomended, but wich one is preferable? (in therms of compression quality/efficience)

Thanks
__________________
So, it works or not???
OvejaNegra is offline   Reply With Quote
Old 29th December 2009, 07:49   #2  |  Link
roozhou
Registered User
 
Join Date: Apr 2008
Posts: 1,181
Of course you should crop black bars and leave a non-mod16 resolution.
Black bars give sharp edges so they hurt compression.
roozhou is offline   Reply With Quote
Old 29th December 2009, 07:58   #3  |  Link
AMED
Registered User
 
AMED's Avatar
 
Join Date: Sep 2004
Location: Auckland, New Zealand
Posts: 449
So encoding at non Mod16 is not an issue with x264 or is it more the playback end that can causes issues with non Mod16 encodes?
__________________
A Man Eating Duck

Last edited by AMED; 29th December 2009 at 08:00. Reason: beer related typos
AMED is offline   Reply With Quote
Old 29th December 2009, 09:14   #4  |  Link
roozhou
Registered User
 
Join Date: Apr 2008
Posts: 1,181
Quote:
Originally Posted by AMED View Post
So encoding at non Mod16 is not an issue with x264 or is it more the playback end that can causes issues with non Mod16 encodes?
Right. Modern decoders like CoreAVC, libavcodec, DivXH264 do not have such problem. Remember that 1920x1080 is not mod16 but 1080p videos play in your media players perfectly.
roozhou is offline   Reply With Quote
Old 29th December 2009, 14:10   #5  |  Link
Caroliano
Registered User
 
Join Date: Feb 2005
Location: São Paulo, Brazil
Posts: 392
Search is always your friend:

http://forum.doom9.org/showthread.ph...ighlight=mod16 <-- short and precise answer
http://forum.doom9.org/showthread.ph...ighlight=mod16 <-- very informative thread
Caroliano is offline   Reply With Quote
Old 29th December 2009, 17:51   #6  |  Link
OvejaNegra
ekTOMBE STUDIOS
 
OvejaNegra's Avatar
 
Join Date: Dec 2005
Location: Cuba
Posts: 253
AWESOME the second th.
Thanks Caroliano!!
Why i could not find that thread? I think we need a better tag system!!
__________________
So, it works or not???
OvejaNegra is offline   Reply With Quote
Old 30th December 2009, 18:30   #7  |  Link
OvejaNegra
ekTOMBE STUDIOS
 
OvejaNegra's Avatar
 
Join Date: Dec 2005
Location: Cuba
Posts: 253
For avoid creating a new thread (but maybe i'm a little ou of topic):
Xvid can do non mod 16 resolutions? Or not?
__________________
So, it works or not???
OvejaNegra is offline   Reply With Quote
Old 30th December 2009, 19:03   #8  |  Link
roozhou
Registered User
 
Join Date: Apr 2008
Posts: 1,181
Don't know about xvid, but Divx supports non-mod16:
Quote:
Video
ID : 0
Format : MPEG-4 Visual
Format settings, BVOP : Yes
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Muxing mode : Packed bitstream
Codec ID : DX50
Codec ID/Hint : DivX 5
Duration : 2mn 6s
Bit rate : 8 054 Kbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 30.000 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.129
Stream size : 121 MiB (97%)
Writing library : DivX 2310
roozhou is offline   Reply With Quote
Old 31st December 2009, 20:16   #9  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 3,977
I think pretty much every codec since MPEG-1 supports non-mod16. Some may require an even number for height/width, but mod16 has long been a best practice, not a hard requirement.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 31st December 2009, 21:56   #10  |  Link
mariush
Registered User
 
Join Date: Dec 2008
Posts: 590
If i remember correctly xvid required width and height multiple of 4. I think it was because of some conversions between yv12 and yuv2 and other color spaces it supported. Huffyuv had the same requirements so I personally got used to cropping to multiples of 4.

As for x264, i think internally just duplicates the last line(s) to reach a multiple of 16. In some cases (mpc-hc with dxva decoding of 1920x1080 on 1920x1200 screen) I could see those duplicated lines and it was a bit annoying.

To answer the original question, I always crop the black lines out unless the destination is some device that only accepts some fixed resolutions. I also try to keep both width and height multiples of 16, 8 or in worst case multiples of 4. A couple of lines cut out to have a multiple of 4 at least, won't be noticeable.
mariush is offline   Reply With Quote
Old 4th January 2010, 15:48   #11  |  Link
OvejaNegra
ekTOMBE STUDIOS
 
OvejaNegra's Avatar
 
Join Date: Dec 2005
Location: Cuba
Posts: 253
So, the decoder must be capable of hiding the added lines?
But if any tool checks the videos (for example the mediainfo library) it will detect that the video has those padding lines or it will report the number of "usefull lines" ?

Thanks for the answers and happy 2010 to everyone
__________________
So, it works or not???
OvejaNegra is offline   Reply With Quote
Old 5th January 2010, 16:26   #12  |  Link
Caroliano
Registered User
 
Join Date: Feb 2005
Location: São Paulo, Brazil
Posts: 392
For your first question, the answer is yes. But I think that any H.264 compilant, non-buggy decoder should be able to do that. Remember, 1080p is not mod16. As for mediainfo I don't know the answer.
Caroliano is offline   Reply With Quote
Old 6th January 2010, 14:53   #13  |  Link
OvejaNegra
ekTOMBE STUDIOS
 
OvejaNegra's Avatar
 
Join Date: Dec 2005
Location: Cuba
Posts: 253
Thank you.
I'll find out about mediainfo.
__________________
So, it works or not???
OvejaNegra is offline   Reply With Quote
Old 6th January 2010, 15:31   #14  |  Link
Keiyakusha
契約者
 
Keiyakusha's Avatar
 
Join Date: Jun 2008
Posts: 1,578
Quote:
Originally Posted by OvejaNegra View Post
But if any tool checks the videos (for example the mediainfo library) it will detect that the video has those padding lines or it will report the number of "usefull lines" ?
Etto... if you mean h264 here, If image is not mod16, it always has padding to the closest mod16 number... you don't need any tool for this.
Keiyakusha is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:16.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.