View Full Version : what is the formula used in Tweak
Annbb
18th November 2008, 04:25
hi,
Since i found the Tweak can increase the brightness and also the PNSR.
Does anyone know what is the formula or theory used for bright in Tweak?
Please give me some idea about bright of Tweak.
Thanks a lot for your help.:readfaq:
IanB
18th November 2008, 14:06
int y = int((i - 16)*_cont + _bright + 16.5);
i = min(max(y,minY),maxY);
Soulhunter
18th November 2008, 14:10
Since i found the Tweak can increase the brightness and also the PNSR...
Please explain what you did? :rolleyes:
Annbb
19th November 2008, 02:06
Dear InaB,
Thanks for your replying.
int y = int((i - 16)*_cont + _bright + 16.5);
The _bright and _cont are control by us, then what is i in this expression.
Annbb
19th November 2008, 02:21
Dear Soulhunter,
After using Avisynth I feel the processed video is a little bit dark.
And the PSNR seems not good compared with the original video.
So in order to improve the PSNR the direct way is to increase the brightness (my thinking is like this, i am not sure is this right or not). The result shows increase brightness (ex. bright=10) can improve the PSNR.
That's why I use Tweak to do it.
But I also want to know what kind of method used in Tweak to adjust the brightness.
Thanks for your interested.
Mug Funky
19th November 2008, 02:49
unless there's something going wrong in VfW or the input, avisynth wont touch the colours of your video.
the only way i could see increasing brightness as a way to improve PSNR is if it pushes several block-sized areas into clipping, hence making those blocks encode losslessly and freeing up bits for other areas. this is not a desirable thing though - clipping is not something that should be done lightly as it destroys parts of the original signal.
IanB
19th November 2008, 03:16
Dear IanB,
Thanks for your replying.
int y = int((i - 16)*_cont + _bright + 16.5);
The _bright and _cont are control by us, then what is i in this expression.
i is the luma value of the pixel being transformed.
The formula is applied to every pixel in every frame.
Annbb
19th November 2008, 06:54
Dear IanB,
Thanks a lot.
Could you please suggest some document related to this issue for me.
Thanks in advance.
Ann
Guest
19th November 2008, 15:32
I wrote the original Tweak() filter. I got the idea from a block diagram of TV video controls in the book Video Demystified. That would be a good start.
The Tweak() adjustments are pretty simple. There's not much to write about them.
I also don't see how Tweak() could improve PSNR.
Wilbert
19th November 2008, 23:04
The documentation of ColorYUV also explains something about this stuff (contrast, brightness, etc ...). The documentation of Histogram explains something about Hue and Saturation.
Soulhunter
19th November 2008, 23:17
unless there's something going wrong in VfW or the input, avisynth wont touch the colours of your video.
the only way i could see increasing brightness as a way to improve PSNR is if it pushes several block-sized areas into clipping, hence making those blocks encode losslessly and freeing up bits for other areas. this is not a desirable thing though - clipping is not something that should be done lightly as it destroys parts of the original signal.
My thoughts exactly! Thats why I questioned his statement... If PSNR between source and final encode is raised by tweak, something is wrong with the processing chain. If PSNR between filtered input and encode is raised by tweak, its probably just a result of clipping (Making image less complex, so more compressible, by blowing away details in bright areas) and/or a "error" in teh processing chain. :\
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.