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 > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st August 2021, 17:46   #1  |  Link
tonemapped
Video Fanatic
 
tonemapped's Avatar
 
Join Date: Jul 2021
Location: Surrey
Posts: 89
2021 Consensus on Sample Adaptive Offset (sao)

I've read thousands of posts over hundreds of threads going back to ~2015 and it seems there's a lack of consensus over disabling sao for an encode, with many people saying it produces a 'wax-like' result.

With the relative maturity of x265, what's your opinion and why (for or against)?
__________________
PC: R9 5900X | 32GB 3600 MT/s RAM | 2*1TB NVMe | RTX 3080 | water-cooled

NAS: SM 48-bay 240TB+ storage | Xeon 1220 | 32GB DDR4 ECC

HTPC: Pentium J5005 | 16GB RAM | 256GB SSD | 15W
tonemapped is offline   Reply With Quote
Old 1st August 2021, 17:54   #2  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,843
i never use SAO. Blurs too much.
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is online now   Reply With Quote
Old 1st August 2021, 19:11   #3  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,717
SAO = Smooth All Objects . It's not usable at all so I always disable it.
x265 may be mature, but SAO has had little development apart from the possibility to use it only on certain frame types.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 2nd August 2021, 20:01   #4  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,738
Yeah, SAO in HEVC has a good amount of flexibility with parameters, but x265 only uses a fixed set. And I don't think there is any way to tweak them.

SAO is a big help at lower bits-per-pixel, but there's a crossover point if detail is prioritized over compression efficiency.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 3rd August 2021, 07:52   #5  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
And the reason for the lack of manual SAO settings was discussed earlier? I thought about it for the first time today
__________________
Win10x64, Xeon E5450, GTX 750 2GB, DDR3 8GB.
Gravitator is offline   Reply With Quote
Old 3rd August 2021, 18:34   #6  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,738
Quote:
Originally Posted by Gravitator View Post
And the reason for the lack of manual SAO settings was discussed earlier? I thought about it for the first time today
Five years ago it was on MCW's list of "something we can take a look at eventually" but there was much lower hanging fruit. I don't know that anyone has taken a serious look at it since. Does anyone know if other encoders do anything different or more elaborate with SAO?

I did find this paper proposing one implementation of it: https://ieeexplore.ieee.org/document/7889300
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 5th August 2021, 18:20   #7  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 341
When I checked a couple of years ago the x265 implementation of SAO was broken. When I checked recently with x265 version 3.4 it was still broken. And with broken I mean artifacts broken and not bad subjective quality broken.
rwill is offline   Reply With Quote
Old 5th August 2021, 23:52   #8  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,738
Quote:
Originally Posted by rwill View Post
When I checked a couple of years ago the x265 implementation of SAO was broken. When I checked recently with x265 version 3.4 it was still broken. And with broken I mean artifacts broken and not bad subjective quality broken.
Do you know of any encoders with superior SAO implementations?
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 6th August 2021, 00:25   #9  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 341
Quote:
Originally Posted by benwaggoner View Post
Do you know of any encoders with superior SAO implementations?
Sure.
rwill is offline   Reply With Quote
Old 6th August 2021, 13:00   #10  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,869
Quote:
Originally Posted by rwill View Post
Sure.
Such as...?
FranceBB is offline   Reply With Quote
Old 7th August 2021, 02:03   #11  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,986
I personally leave SAO on unless I'm targeting transparency. The blocking suppression is too good, even if the loss in fine detail in still frame comparison makes it look bad at first glance.

In terms of an ABR ladder that means almost always leaving it on. Maybe the very top rungs get it disabled.

I wonder if Ateme has a better SAO implementation? They have a lot of really sharp folks working on HEVC, AV1, and VVC these days. Maybe Beamr as well? They're both the first names that come to mind for good commercial HEVC encoders. I've not deeply evaluated either
Blue_MiSfit is offline   Reply With Quote
Old 7th August 2021, 11:44   #12  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 341
Quote:
Originally Posted by Blue_MiSfit View Post
I personally leave SAO on unless I'm targeting transparency. The blocking suppression is too good, even if the loss in fine detail in still frame comparison makes it look bad at first glance.
With "blocking suppression", do you mean what you get when you encode something like this:

https://drive.google.com/file/d/1U_l...ew?usp=sharing

With a x265 command line like this:

Code:
./x265-10b.exe --input gradient_with_noise_1920x1080_10b.yuv --fps 24000/1001 --input-depth 10 --input-res 1920x1080 --crf 30 --preset veryslow -o sao_failure.265
?
rwill is offline   Reply With Quote
Old 8th August 2021, 06:59   #13  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,986
Fascinating! I see the opposite with real world content, typically

By blocking suppression I mean that if you compare two low bitrate encodes that are identically configured other than one having SAO enabled and one having it disabled, some of the blocking artifacts (particularly in motion) in the version without SAO will not be visible in motion in the version with SAO enabled.
__________________
These are all my personal statements, not those of my employer :)

Last edited by Blue_MiSfit; 8th August 2021 at 07:05.
Blue_MiSfit is offline   Reply With Quote
Old 8th August 2021, 10:39   #14  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 341
Quote:
Originally Posted by Blue_MiSfit View Post
Fascinating! I see the opposite with real world content, typically

By blocking suppression I mean that if you compare two low bitrate encodes that are identically configured other than one having SAO enabled and one having it disabled, some of the blocking artifacts (particularly in motion) in the version without SAO will not be visible in motion in the version with SAO enabled.
Actually it means YOUR real world content does not have film grain. If you take movies like, for example, Aliens, Safehouse, Titanic, Miami Vice, The Wizard of Oz (1939), Taxi Driver or The Grey - they all trigger this effect.

Regarding you statement about blocks going away, I hope you know SAO works only on 64x64 blocks or whatever LCU size you have configured so I guess either your blocks in motion are aligned on a 64x64 block grid that SAO can work on or you are seeing things.
rwill is offline   Reply With Quote
Old 8th August 2021, 20:41   #15  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,351
Quote:
Originally Posted by rwill View Post
Quote:
Originally Posted by benwaggoner View Post
Do you know of any encoders with superior SAO implementations?
Sure.
Then please name them.

For the notes... the last I checked, Rovi's HEVC Encoder in the TotalStudio software offered three types of SAO — for luma only, for chroma only, and for both luma and chroma.
But there were no user-configurable parameters and I didn't bother to check whether their SAO implementation was good or not.

Last edited by filler56789; 8th August 2021 at 20:42. Reason: .
filler56789 is offline   Reply With Quote
Old 8th August 2021, 21:37   #16  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 341
Quote:
Originally Posted by filler56789 View Post
Then please name them.

For the notes... the last I checked, Rovi's HEVC Encoder in the TotalStudio software offered three types of SAO — for luma only, for chroma only, and for both luma and chroma.
But there were no user-configurable parameters and I didn't bother to check whether their SAO implementation was good or not.
Any encoder not having a broken SAO implementation should be superior. Its not hard to do really so my guess is all comercial encoders do it right one way or the other. And I think in this time and age one can expect to not get really bad artifacts by having a tool thats enabled by default. Asking if someone knows of an encoder that has a better SAO implementation, like one that does not totally wreck the picture, is grotesque. The question is rather why Multicoreware does not fix their x265 SAO implementation. The problems have been present since day 1 and have been reported shortly after.

SAO has 6 different modes it can apply to a CTU, the most important mode is the "dont touch the pixels" mode if an encoder cannot derive satisfactory parameters for the modes that actually do change some of the pixels. x265 produces worse results when SAO is enabled as can be seen with the sequence I posted. x265 just shouldnt modify a CTU through SAO if it cannot derive parameters that improve the CTU subjective or objectively but it does anyway.
rwill is offline   Reply With Quote
Old 9th August 2021, 00:56   #17  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,403
Quote:
Originally Posted by rwill View Post
Any encoder not having a broken SAO implementation should be superior. Its not hard to do really so my guess is all comercial encoders do it right one way or the other.
I do not think this is a safe guess. It might be true, but just because they are "commercial" does not mean they do it any better.

Do you have any experience with any of them doing better?
__________________
madVR options explained
Asmodian is offline   Reply With Quote
Old 9th August 2021, 05:25   #18  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 341
Quote:
Originally Posted by Asmodian View Post
I do not think this is a safe guess. It might be true, but just because they are "commercial" does not mean they do it any better.

Do you have any experience with any of them doing better?
I develop software video encoders for a living. I know that my HEVC encoder is doing SAO better.
rwill is offline   Reply With Quote
Old 9th August 2021, 10:04   #19  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
At least reduce the impact a little. How are things going with VVC?
Code:
--limit-sao --sao-non-deblock
__________________
Win10x64, Xeon E5450, GTX 750 2GB, DDR3 8GB.
Gravitator is offline   Reply With Quote
Old 9th August 2021, 22:09   #20  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,738
Quote:
Originally Posted by rwill View Post
I develop software video encoders for a living. I know that my HEVC encoder is doing SAO better.
Can you share which is yours?
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Reply

Tags
sample adaptive offset, sao

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 10:25.


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