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. |
6th July 2008, 16:31 | #41 | Link |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
Ding ding ding, we have a winner!
I'm going to guess its related to how frame_init_lowres interacts with ratecontrol in threaded mode. If this is true, then the following changes will both solve the problem: 1. Disable frame_init_lowres asm (but don't disable anything else). 2. Add x264_emms() after the call to frame_init_lowres asm. My build environment doesn't support threads, so I'll have to find someone to make you a few builds to test. |
6th July 2008, 16:44 | #43 | Link | |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
Quote:
Code:
if( h->frames.b_have_lowres ) x264_frame_init_lowres( h, fenc ); For idea 1 above, find the following code in common/x86/mc-c.c: Code:
pf->frame_init_lowres_core = x264_frame_init_lowres_core_mmxext; Code:
pf->frame_init_lowres_core = x264_frame_init_lowres_core_cache32_mmxext; Code:
pf->frame_init_lowres_core = x264_frame_init_lowres_core_cache32_mmxext; Test with no modifications, with just idea 1, and with just idea 2, and see if any of them resolve the issue. |
|
6th July 2008, 17:24 | #44 | Link |
Registered User
Join Date: May 2006
Posts: 957
|
Here you go. 7-zip archive contains two builds with threads of the two ideas.
http://users.telenet.be/darnley/x264-lowres-ideas.7z Dark_Shikari, you posted two identical lines. Is that correct? It does appear twice in mc-c.c for cacheline 32 and 64.
__________________
x264 log explained || x264 deblocking how-to preset -> tune -> user set options -> fast first pass -> profile -> level Doom10 - Of course it's better, it's one more. |
6th July 2008, 17:26 | #45 | Link | |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
Quote:
It needs to be three builds, so that a comparison can be made with a normal build to see if that one is broken too. |
|
6th July 2008, 17:33 | #46 | Link |
Registered User
Join Date: May 2006
Posts: 957
|
Ah, ok. I'll re-upload the archive. But I can say that for a first pass target of 500 the two ideas now give 515 instead of ~20000.
[EDIT] Three build archive uploaded.
__________________
x264 log explained || x264 deblocking how-to preset -> tune -> user set options -> fast first pass -> profile -> level Doom10 - Of course it's better, it's one more. Last edited by J_Darnley; 6th July 2008 at 17:36. |
6th July 2008, 18:03 | #47 | Link |
Registered User
Join Date: Oct 2004
Location: France
Posts: 567
|
Sorry J_Darnley I've already made my test builds when you've posted but I was answering a phone call ...
Test builds gcc 3.4.5 fprofiled : Test builds ... Default build : Code:
E:\film>x264-default.exe --pass 1 --bitrate 500 --stats "default.stats" --bframes 16 --b-pyramid --direct auto --filter 0:0 --subme 1 --analyse none --me dia --threads auto --thread-input --progress --no-psnr --no-ssim --output "default.mkv" "1x01-p1.avs" avis [info]: 704x528 @ 25.00 fps (1001 frames) x264 [info]: using cpu capabilities: MMX2 SSE2Slow x264 [info]: slice I:12 Avg QP:12.66 size: 74475:00:00 x264 [info]: slice P:542 Avg QP:12.75 size: 60999 x264 [info]: slice B:447 Avg QP:14.26 size: 26072 x264 [info]: mb I I16..4: 15.1% 0.0% 84.9% x264 [info]: mb P I16..4: 27.6% 0.0% 0.0% P16..4: 65.7% 0.0% 0.0% 0.0% 0.0% skip: 6.6% x264 [info]: mb B I16..4: 3.8% 0.0% 0.0% B16..8: 43.2% 0.0% 0.0% direct:28.8% skip:24.2% x264 [info]: final ratefactor: -1.#J x264 [info]: direct mvs spatial:99.3% temporal:0.7% x264 [info]: kb/s:9112.7 encoded 1001 frames, 58.29 fps, 9112.89 kb/s Code:
E:\film>x264-idea-1.exe --pass 1 --bitrate 500 --stats "idea-1.stats" --bframes 16 --b-pyramid --direct auto --filter 0:0 --subme 1 --analyse none --me dia --threads auto --thread-input --progress --no-psnr --no-ssim --output "idea-1.mkv" "1x01-p1.avs" avis [info]: 704x528 @ 25.00 fps (1001 frames) x264 [info]: using cpu capabilities: MMX2 SSE2Slow x264 [info]: slice I:12 Avg QP:30.99 size: 11820:00:00 x264 [info]: slice P:542 Avg QP:33.31 size: 4208 x264 [info]: slice B:447 Avg QP:35.87 size: 861 x264 [info]: mb I I16..4: 47.3% 0.0% 52.7% x264 [info]: mb P I16..4: 23.5% 0.0% 0.0% P16..4: 36.7% 0.0% 0.0% 0.0% 0.0% skip:39.8% x264 [info]: mb B I16..4: 1.2% 0.0% 0.0% B16..8: 15.5% 0.0% 0.0% direct: 2.9% skip:80.5% x264 [info]: final ratefactor: 31.94 x264 [info]: direct mvs spatial:94.9% temporal:5.1% x264 [info]: kb/s:560.9 encoded 1001 frames, 87.76 fps, 561.11 kb/s Code:
E:\film>x264-idea-2.exe --pass 1 --bitrate 500 --stats "idea-2.stats" --bframes 16 --b-pyramid --direct auto --filter 0:0 --subme 1 --analyse none --me dia --threads auto --thread-input --progress --no-psnr --no-ssim --output "idea-2.mkv" " 1x01-p1.avs" avis [info]: 704x528 @ 25.00 fps (1001 frames) x264 [info]: using cpu capabilities: MMX2 SSE2Slow x264 [info]: slice I:12 Avg QP:30.99 size: 11820:00:00 x264 [info]: slice P:542 Avg QP:33.31 size: 4208 x264 [info]: slice B:447 Avg QP:35.87 size: 861 x264 [info]: mb I I16..4: 47.3% 0.0% 52.7% x264 [info]: mb P I16..4: 23.5% 0.0% 0.0% P16..4: 36.7% 0.0% 0.0% 0.0% 0 .0% skip:39.8% x264 [info]: mb B I16..4: 1.2% 0.0% 0.0% B16..8: 15.5% 0.0% 0.0% direct: 2.9% skip:80.5% x264 [info]: final ratefactor: 31.94 x264 [info]: direct mvs spatial:94.9% temporal:5.1% x264 [info]: kb/s:560.9 encoded 1001 frames, 90.10 fps, 561.11 kb/s Last edited by Underground78; 6th July 2008 at 18:12. |
6th July 2008, 18:30 | #49 | Link |
Registered User
Join Date: Oct 2004
Location: France
Posts: 567
|
It works :
Code:
E:\film>x264-fixed --pass 1 --bitrate 500 --stats "fixed.stats" --bframes 16 --b-pyramid --direct auto --filter 0:0 --subme 1 --analyse none --me dia --threads auto --thread-input --progress --no-psnr --no-ssim --output "fixed.mkv" "1x01-p1.avs" avis [info]: 704x528 @ 25.00 fps (1001 frames) x264 [info]: using cpu capabilities: MMX2 SSE2Slow x264 [info]: slice I:12 Avg QP:30.99 size: 11820:00:00 x264 [info]: slice P:542 Avg QP:33.31 size: 4208 x264 [info]: slice B:447 Avg QP:35.87 size: 861 x264 [info]: mb I I16..4: 47.3% 0.0% 52.7% x264 [info]: mb P I16..4: 23.5% 0.0% 0.0% P16..4: 36.7% 0.0% 0.0% 0.0% 0.0% skip:39.8% x264 [info]: mb B I16..4: 1.2% 0.0% 0.0% B16..8: 15.5% 0.0% 0.0% direct: 2.9% skip:80.5% x264 [info]: final ratefactor: 31.94 x264 [info]: direct mvs spatial:94.9% temporal:5.1% x264 [info]: kb/s:560.9 encoded 1001 frames, 91.65 fps, 561.11 kb/s |
18th March 2009, 14:56 | #50 | Link |
Registered User
Join Date: Dec 2005
Posts: 39
|
I had to reverted to a x264 version from 2008 04 08 ... The one I was using right now was from 2008:12:30. The difference is ubntu jaunty vs ubuntu intrepid :P
Anyway new x264 has a worse CRF mode... although crf 22 gave me the old crf 20 quality, the size is actually larger ... The settings for both encodes are the same with a difference that with the new one I removed bime and brdo from command line and instead use subme 7. (which is due to x264 api changes) Old crf=20 minami-ke 08 size 42 MB gundam 00 s2 20 size 80 MB new crf=22 minami-ke 08 size 56 MB gundam 00 s2 20 size 84 MB Munto 05 old = 54 mb new=70 mb Now the difference on the same files shows that new crf mode is less efficient then the old one... So I consider this a bug since new version provides the same quality but with a lot larger files . Last edited by garbii; 18th March 2009 at 14:59. |
18th March 2009, 15:01 | #51 | Link |
Mr. Sandman
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
|
that's not a bug but an intended behaviour.
talking about compression efficiency and CRF doesnt have much sense. fact is, at the same filesize, the new x264 version gives better quality. hence, use the newer version and rise the CRF until you get your desirer filesize (and as i said, at the same filesize, you'll get a better quality).
__________________
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!!! |
18th March 2009, 15:14 | #52 | Link | |
Registered User
Join Date: Dec 2005
Posts: 39
|
Quote:
|
|
18th March 2009, 15:17 | #53 | Link | |
Registered User
Join Date: Mar 2005
Location: Finland
Posts: 2,641
|
Quote:
Looks like your source is anime. The 2008-04 version of x264 didn't have psy-RD, which may not be a good idea for animation. Now psy-RD is enabled by default, so try disabling it with --psy-rd 0.0:0.0 (or psy-rd=0.0,0.0 if you use MEncoder). |
|
18th March 2009, 16:06 | #54 | Link | |
Mr. Sandman
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
|
Quote:
as nm said, try disabling psy options since your encode is anime.
__________________
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!!! |
|
19th March 2009, 09:20 | #55 | Link |
Registered User
Join Date: Dec 2005
Posts: 39
|
I enabled psy-rd=0.0,0.0 and gave new build a try I still have the same problem though... Let me rephrase. CRF should be a stable quality factor so once I choose the crf value I like it should always give me the same quality on files, or similiar at least. This is not the case with new crf, where I should consider the source and then choose the crf and if I have to do that I might as well use good old 2pass bitrate.
Extreme example of non action source vs a very demanding fast paced source: Old crf=20 gundam 00 s2 ep 23 140 MB mianami-ke okaeri 10 43 MB both encodes have similiar quality. Both files are a 20 minutes shows. New crf=24 gundam 00 s2 ep 23 81 MB mianami-ke okaeri 10 45 MB While the non action minami has good quality the 80 mb gundam encode just sucks in terms of quality. New crf=22 gundam 00 s2 ep 23 100 MB mianami-ke okaeri 10 53 MB Quality wise minami seems the same as crf=24, it size is larger though ... Gundam is better then the previous encode but still not as good as the 140 MB encode which is just natural I find it that new crf behavour makes this mode uselles for me. This example should really show that the previous version was better at keeping the same quality and not over enlarging filesize where not needed . With the old mode I could just set it to one value and not worry because all my encodes ended with similiar quality, with the new mode I would have to use 21 or maybe 20 for gundam and 24 for minami ... Now for me that's not what constant quality mode should be all about. Last edited by garbii; 19th March 2009 at 09:29. |
19th March 2009, 09:28 | #56 | Link | |
x264 developer
Join Date: Sep 2005
Posts: 8,666
|
Quote:
Unless you can come up with a magical algorithm for judging the human visual system, there is no guarantee that any CRF algorithm will give equivalent quality across all sources--in fact, it's almost guaranteed it will not. Anyways, the proper approach here is not to blame CRF but to adjust qcomp until you are satisfied with the mapping between CRF and quality level. Also, though you probably don't realize this, there have actually been three CRFs. 1. Original CRF (similar to current CRF) 2. CRF after AQ (qcomp completely disabled) 3. New CRF (most similar to original CRF) Let me put this in a nice large font size here: During 2), CRF was effectively broken. The "new" CRF merely restored the original behavior. If you don't like this behavior, what you really want is qcomp=1, i.e. disabled.
__________________
Follow x264 development progress | akupenguin quotes | x264 git status ffmpeg and x264-related consulting/coding contracts | Doom10 Last edited by Dark Shikari; 19th March 2009 at 09:33. |
|
19th March 2009, 11:54 | #57 | Link | |
Registered User
Join Date: Apr 2007
Posts: 464
|
Quote:
1 = <r968 2 = r968 3 = >r???? cheers audyovydeo |
|
19th March 2009, 12:23 | #58 | Link | |
Registered User
Join Date: Mar 2005
Location: Finland
Posts: 2,641
|
Quote:
1: rev < r804 (variance-based psy adaptive quantization) 2: r804 <= rev < r968 3: rev >= r968 (move adaptive quantization to before ratecontrol, eliminate qcomp bias) |
|
24th March 2009, 09:43 | #59 | Link | |
Registered User
Join Date: Dec 2005
Posts: 39
|
Quote:
The quality of the mentioned ep is still quite good (not as good as the 140 mb one obviously) and I'm aiming to end up with small files anyway so I'm happy Thank you for your help, and I still don't like how the normal non "broken" crf behaves ... oh well ... Last edited by garbii; 24th March 2009 at 09:46. |
|
8th August 2009, 10:22 | #60 | Link |
Registered User
Join Date: Mar 2005
Posts: 65
|
error malloc size
I get the error malloc size with de x264 r1201 (32 bits).
I have the following command line: x264 --crf 16 --keyint 240 --min-keyint 24 --scenecut 40 --bframes 16 --b-adapt 2 --ref 4 --deblock 0:0 --qpmin 5 --qpmax 24 --aq-mode 1 --aq-strength 0.25 --mbtree --partitions all --direct auto --weightb --me tesa --merange 32 --mvrange -1 --mvrange-thread -1 --subme 9 --psy-rd 1.0:0.0 --mixed-refs --8x8dct --trellis 2 --no-fast-pskip --no-dct-decimate --nr 0 --threads auto --thread-input --output "video.mkv" "video.avs" My avs is: DirectShowSuorce("video.,m2ts") Crop(Crop(0,132,-0,-132) The source is a 1080p video, which I do a crop. If I do a resize to 640x368 for example I don't have any problem. I have a Core 2 Duo E6750 with 2GB of RAM, winth windows vista x64. Thanks. Daimroc. |
|
|