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. |
11th October 2005, 03:47 | #1 | Link |
Registered User
Join Date: Jan 2005
Posts: 191
|
x264 now allows non-mod16 resolutions!
As of revision 327 x264 allows non-mod16* resolutions. No more "width % 16 != 0 or height % 16 != 0" error messages
Now we can use: mod16 - valid (example 720x432) mod8 - valid (example 712x424) mod4 - valid (example 716x428) width mod4, height mod2 - valid (example 716x430) width mod2, height mod4 - invalid (example 718x428) -> Avisynth error: YV12 images for output must have a width divisible by 4 (use crop)! However if either width or height is not divisible by 16, compression will suffer, so if possible always use mod16. *note: The module (mod) is the remainder produced by dividing two integers. For example if we treat 20 / 6 as an integer divison, the quotient is 3 (rather than 3.333..) and the remainder is 2. Last edited by hpn; 11th October 2005 at 18:05. |
11th October 2005, 08:52 | #5 | Link | |
Registered User
Join Date: Jan 2005
Posts: 191
|
Quote:
LoadPlugin("Z:\Program Files\dgmpgdec\DGDecode.dll") mpeg2source("G:\DVD\a.d2v") ConvertToRGB32() crop(0,72,718,430) Then open the script in VirtualDub and in menu "Video"->"Color Depth" under "Output format to compressor/display" select "4:2:0 planar". Now you'll be able to make mod2 encodes with x264. I don't know if this is the best way to work around this mod2 problem. I still can't find a way to make width/height mod2 with CLI, no matter if I use ConvertToRGB32() or not. CLI returns: avis [error]: unsupported input format (DIB ) could not open input file 'b.avs' |
|
11th October 2005, 09:24 | #7 | Link |
Registered User
Join Date: Jan 2005
Posts: 191
|
Thank you, akupenguin. Your help is invaluable as always. I was very suspicious about converting to RGB, but that was the first thing I tried and It worked. I'll try again with avs2yuv
Last edited by hpn; 11th October 2005 at 09:49. |
11th October 2005, 11:35 | #8 | Link |
Registered User
Join Date: Nov 2001
Posts: 9,770
|
great stuff!
but i have two questions: 1) what does x264 use to stuff the frame for getting a mod16 resolution? i see that mplayer displays a green line 2) pengvado, will you add frame cropping support to libavcodec?
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau) I know, that I know nothing (Socrates) MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide) Ogg Theora | Ogg Vorbis use WM9 today and get Micro$oft controlling the A/V market tomorrow for free |
11th October 2005, 17:54 | #9 | Link |
retired developer
Join Date: Oct 2002
Location: Canada
Posts: 8,978
|
sweeeeeeeeeeeeeet
__________________
Detritus Software |
11th October 2005, 20:44 | #11 | Link | ||
Registered User
Join Date: Nov 2001
Posts: 9,770
|
Quote:
Quote:
- in ffdshow i see pink artefacts and black borders at the top and the bottom (its frame_crop_top_offset: 0 and frame_crop_bottom_offset: 3 in the sps tough) - in mplayer i dont see pink artefacts, but a green border at the bottom of the frame i attached screenshots showing this
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau) I know, that I know nothing (Socrates) MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide) Ogg Theora | Ogg Vorbis use WM9 today and get Micro$oft controlling the A/V market tomorrow for free |
||
11th October 2005, 23:26 | #12 | Link | |
Registered User
Join Date: Nov 2003
Location: San Diego, CA
Posts: 325
|
Quote:
I wrote a JPEG library (based on libjpeg) and found that proper mirroring will both increase quality on the edge and decrease file size (not by much, mind you, but every bit counts) What I did: Replicate the edge pixel to the nearest power of 2, then mirror those pixels to the next power of 2, then mirror again, etc.. For example: Code:
[a,b,c,d,e] -> [a,b,c,d,e,e,e,e] [a,b,c,d] -> [a,b,c,d,d,c,b,a] [a,b,c] -> [a,b,c,c,c,c,b,a] [a,b] -> [a,b,b,a,a,b,b,a] (*) Perhaps mirroring to mod 4, then replicating only the DC component to other 4x4 blocks... just an idea. (*) Due to the way the DCT is designed, the DCT of this block is actually lossless, as long as the quantizers are low enough. I made a "lossless JPEG" proof-of-concept which mirrored every 2x2 input block into an 8x8 JPEG block, which was capable of perfect reconstruction.
__________________
"We demand rigidly defined areas of doubt and uncertainty!" - Vroomfondel, H2G2 |
|
12th October 2005, 08:14 | #15 | Link | |
Registered User
Join Date: Nov 2003
Location: San Diego, CA
Posts: 325
|
Quote:
__________________
"We demand rigidly defined areas of doubt and uncertainty!" - Vroomfondel, H2G2 |
|
12th October 2005, 17:46 | #16 | Link |
Registered User
Join Date: Nov 2001
Posts: 9,770
|
hm my settings were the following:
Code:
x264 --bitrate 770 --ratetol 1 --bframe 3 --b-pyramid --ref 5 --mixed-refs --filter -5:-5 --8x8dct --analyse all --weightb --progress -o raw.264 input.avs i updated my ffdshow to a compile from 30 september and the pinkyness is gone still there is the small black bar on the top and bottom of the frame. is this a problem?
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau) I know, that I know nothing (Socrates) MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide) Ogg Theora | Ogg Vorbis use WM9 today and get Micro$oft controlling the A/V market tomorrow for free |
12th October 2005, 18:48 | #17 | Link |
Retired AviSynth Dev ;)
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
|
Right now the MOD4 restriction in AviSynth is there because no codec has been capable of decoding this. Or at least XviD hasn't. We can implement an override switch for AviSynth 2.6, so you can leave out the YUV->RGB->YUV conversion.
__________________
Regards, sh0dan // VoxPod |
12th October 2005, 19:18 | #18 | Link | ||
Registered User
Join Date: Jan 2005
Posts: 191
|
Quote:
Quote:
Last edited by hpn; 12th October 2005 at 19:28. |
||
12th October 2005, 19:57 | #19 | Link |
Mr. Sandman
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
|
usually the green line is due to improperly used filters (like deinterlacers) or other filters that does not support the selected resolution.
__________________
MPEG-4 ASP Custom Matrices: EQM V1(old), EQM AutoGK Sharpmatrix (aka EQM V2), EQM V3HR (updated 01/10/2004), EQM V3LR, EQM V3ULR (updated 04/02/2005), EQM V3UHR (updated 17/12/2004) and EQM V3EHR (updated 05/10/2004) Info about my ASP matrices. MPEG-4 AVC Custom Matrices: EQM AVC-HR Info about my AVC matrices My x264 builds. Mooo!!! |
5th April 2006, 07:33 | #20 | Link |
Learning...
Join Date: Nov 2005
Location: 12.97°N, 77.56°E
Posts: 135
|
I see the "green line" problem if non-mod16 height in MPC 6.4.9.0 with VMR7/VMR9 (renderless)+CoreAVC 0.4
No problems with overlay or windowed output. Last edited by ariga; 5th April 2006 at 08:25. |
|
|