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 > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th December 2024, 22:43   #381  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,823
Quote:
Originally Posted by hello_hello View Post
I think the same applies to FMTConv
I deeply encourage you to use FMTconv when dithering down, instead of AVS+ implicits or z_img, at least for its wider dithering choices and resilience of some of them (i.e. 8) to codec encoding.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 9th December 2024, 01:15   #382  |  Link
StvG
Registered User
 
Join Date: Jul 2018
Posts: 503
Quote:
Originally Posted by hello_hello View Post
StvG,

I know I asked about 32 bit float handling a while ago, but I'm still not 100% sure how to correctly convert to float and back.

For an 8 bit limited range clip, the frame property becomes full range if I do this:

ConvertBits(32)\
.z_ConvertFormat(colorspace_op="170m:601:170m=>470bg:601:470bg")\
.ConvertBits(8)

ConvertBits can change the frame property back to limited range though, and the result is exactly the same:

ConvertBits(32)\
.z_ConvertFormat(colorspace_op="170m:601:170m=>470bg:601:470bg")\
.ConvertBits(8, fulls=false, fulld=false)

However as you previously said zimg assumes 32-bit float is full range, I'm wondering if I should do it like this. According to Compare() the output isn't the same, but in my head at least, it seems to be the technically correct method. Would that assumption be correct?

Cheers.

ConvertBits(32, fulls=false, fulld=true)\
.z_ConvertFormat(colorspace_op="170m:601:170m=>470bg:601:470bg")\
.ConvertBits(8, fulls=true, fulld=false)
The latest example is the correct one.

If you will use z_ConvertFormat in already converted 32-bit environment you have to be sure that the range is [0,1] (full) before the z_ConvertFormat call.

Quote:
Originally Posted by hello_hello View Post
The output here is very close, but not exactly the same. Maybe a rounding difference when converted back to 8 bit?

Code:
A = ConvertBits(32, fulls=false, fulld=true)\
.z_ConvertFormat(colorspace_op="170m:601:170m=>470bg:601:470bg")\
.ConvertBits(8, fulls=true, fulld=false)

B = z_ConvertFormat(colorspace_op="170m:601:170m=>470bg:601:470bg", bit_depth=32)\
.z_ConvertFormat(bit_depth=8)

Compare(A,B)
Yes, the difference is due to rounding diff.

Last edited by StvG; 9th December 2024 at 01:30.
StvG 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 12:17.


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