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. |
3rd November 2022, 01:14 | #1 | Link |
Registered User
Join Date: Feb 2003
Posts: 106
|
x264 blurring along outside edge of frame
I try to maintain at least mod4 dimensions when cropping while attempting to minimize aspect ratio errors. Sometimes that means not cropping out the black bars completely. However I've noticed that x264 blurs the edges of the frame when there is any amount of black border present (see attached screenshot). I get the same results no matter what settings I use. I don't remember this being an issue before. Is this a new problem with newer builds and is there an older build I can roll back to that didn't have this problem?
Last edited by simple_simon; 3rd November 2022 at 03:15. |
4th November 2022, 13:38 | #4 | Link |
Registered User
Join Date: Feb 2003
Posts: 106
|
Hmmm. Strange I never noticed it before. Is there any workaround? Avisynth filter? Is it better to just crop all the borders then and encode mod2? The tricky part with that would be when the aspect ratio isn't consistent, I'd either need to crop out part of the image on wider AR's to make it uniform or only crop to the widest AR and have blurring on the edges when the AR got narrower.
|
4th November 2022, 17:11 | #5 | Link |
Registered User
Join Date: Jul 2003
Location: Italy
Posts: 1,135
|
The workaround is to remove all the black on the top/bottom bars or have a mod16 black bars. Since you have 16x16 macroblocks, if the macroblock is full black, there's no issue. The problem arise when in a 16x16 macroblock you have some rows with constant black pixels. In those cases, it seems that x264 gets "fooled" and assigns to the macroblock a way higher quantizer, not enough to preserve quality.
Last edited by mp3dom; 4th November 2022 at 17:13. |
4th November 2022, 17:40 | #6 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,733
|
This phenomenon is clearly visible in quite a few commercial encodes as well.
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
4th November 2022, 21:22 | #7 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
I think this is a general "problem", if you have a very sharp edge that is not aligned with a 16×16 macro-block boundary.
Accurately preserving a very sharp edge somewhere in the middle of a macro-block would be incredibly expensive, in terms of bit cost. And since we only have a limited "budget" of bits, these bits probably are spent better somewhere else in the frame
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 4th November 2022 at 21:30. |
4th November 2022, 21:52 | #8 | Link |
Banana User
Join Date: Sep 2008
Posts: 989
|
I don't see black border in your screenshot.
__________________
InpaintDelogo, DoomDelogo, JerkyWEB Fixer, Standalone Faster-Whisper - AI subtitling |
5th November 2022, 14:23 | #9 | Link | |
Registered User
Join Date: Jul 2003
Location: Italy
Posts: 1,135
|
Quote:
This and the other issue (bitrate and quality drop after a very complex scene when vbv is in use) are the real two issues of x264. Unfortunately, I guess they will never be (at least) mitigated or (even better) fixed. |
|
5th November 2022, 15:46 | #10 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
It's also one of the side effects of AQ - bits are taken not only from object edges ("halo" of smoothness around objects), but also frame edges ("halo" of smoothness around frame borders). Does anyone recall the AQ tests on the grainy Island trailer ~15 years ago?
You can reduce the effect at a given bitrate by reducing the AQ strength, and/or using higher bitrates |
5th November 2022, 21:50 | #11 | Link |
Registered User
Join Date: Jul 2003
Location: Italy
Posts: 1,135
|
Well, I'm not sure about using higher bitrates. This problem is exactly the same (same flattest macroblock problem and detail loss) even at bluray bitrates (I mean, a 35 Mbps average). In a grainy source (not extremely grainy, just a standard film-grain) this is still clearly visible. I can't recall another encoder that at these bitrates exhibits the same problem or with this same amount.
Last edited by mp3dom; 7th November 2022 at 23:14. |
7th November 2022, 18:43 | #12 | Link |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
|
Note that 1080p is not mod16. Internally it is 1088 tall with 8 "dummy" lines at the bottom. So to get mod16 when framing into 1080, you want mod16 from the top, and mod16 -8 from the bottom.
Better to just crop to active image area if targeting a format that allows that. |
|
|