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 > VP9 and AV1

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd November 2022, 00:14   #1  |  Link
D3C0D3R
Registered User
 
Join Date: Mar 2010
Location: Ukraine
Posts: 50
Simple patch for AV1 (libaom) for less smothing of texture

Libaom is a great codec, but it has one annoying weakness: it cant preserve fine detail and sharp textures like x264 did.
Even when one lower QPs and boost bitrate into sky.

So I want to share patch which slightly fixes that. I using this quite of time on top of libaom.

I experimented a lot with more complex patches, and simplify results of some experiments into couple lines of very simple code.

But even in this simplest form it already helps across wide range QPs (32-63 test) cpu-used (1,2,3 tested) and video content.

Code:
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index 0334962021..895db71798 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -423,7 +423,13 @@ int av1_compute_rd_mult(const int qindex, const aom_bit_depth_t bit_depth,
     // ARF boost adjustment
     rdmult += ((rdmult * rd_boost_factor[boost_index]) >> 7);
   }
-  return (int)rdmult;

+  double rm =(double) qindex;
+  rm /= 35*4;
+  rm = pow(rm, 0.75);
+  rm *= (double) rdmult;
+  return (int)rm;
 }
 
 int av1_get_deltaq_offset(aom_bit_depth_t bit_depth, int qindex, double beta) {
It slighlty hurts PSNR. But considerably improves SSIM metrics AND texture retention (less smothing).

Code:
cpu-used=3
Metric    BD-Rate (%)   
--------  ----------  
PSNRy           0.99   
PSNRavg         0.64   
SSIMy          -2.47   
SSIMavg        -2.93   
PSNR            0.08   
SSIM           -1.56   
MS-SSIM        -1.98   

cpu-used=2
Metric    BD-Rate (%)
--------  ---------- 
PSNRy           1.23 
PSNRavg         0.80 
SSIMy          -2.42 
SSIMavg        -3.02 
PSNR            0.25 
SSIM           -1.53 
MS-SSIM        -1.90

Last edited by D3C0D3R; 23rd November 2022 at 01:02.
D3C0D3R is offline   Reply With Quote
Old 23rd November 2022, 20:36   #2  |  Link
Gravitator
Registered User
 
Join Date: May 2014
Posts: 292
Бонжур!
Can be obtained in the form of mod.exe file?
__________________
Win10x64, Xeon E5450, GTX 750 2GB, DDR3 8GB.
Gravitator 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 22:22.


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