Log in

View Full Version : Range reduction


kiranrao
31st May 2006, 10:48
How can we modify the registry value so that range reduction is enabled in wmv 9 streams( What should be the value like? in the M$ site the procedure is not clear..)
Thanks in advance

kiranrao
31st May 2006, 11:59
i had tried with wme9 and wmp11 insatlled

mpgxsvcd
31st May 2006, 14:01
i had tried with wme9 and wmp11 insatlled

Ok it is a little confusing. You actually have to force the value in the registry. If you just try to type the value in then it will only let you do 7 characters. You need to enter 8 characters or it will crash WME9. Try copying the value and pasting into the dword value in the registry.

Try copying 1010101 as the dword value. That should be the minimum reduction besides 00000000 which is no reduction. You could also try 08080808 which is the maximum.

I had never actually tried this value until this morning. It really appears to work. It looks like it introduces black crush. Most of the shadow details get reduced considerably. However, the bit rate is reduced considerably also. I might start using this setting now. I had just used 00000000 before.

zambelli
31st May 2006, 23:35
@mpgxsvcd:
See my comment in the other thread. I get the feeling you haven't been setting the range reduction correctly.

@kiranrao:
The setting needs to be entered as an 8-digit hex value, like this:
0y0Y0c0C

Where y is the luma compression factor, Y is the luma expansion factor, c is the chroma compression factor, C is the chroma expansion factor. Each on a scale of 0 to 8.

Example:
0x04040000
This would reduce the amount of luma information by half. The second "04" instructs the decoder to expand the range back to normal - with reduced accuracy. If you were to replace the second "04" with "00", the decoded image would look wrong - probably very grayish.

kiranrao
1st June 2006, 06:56
Thanks for the tips. But i'm still not getting what the reduction and expansion factors are for. the expansion factor should always be equal to the reduction factor. then why there is a provision for entering both in registry? As far as my knowledge goes, when range reduction is enabled at the time of decoding for a stream, the pixel values form 0-255 which should be originally there are reduced to the range 64-191. So depending on the frame range reduction setting of current frame(say P), we change the range of the reference(say I frame-previously reconstructed) so as to bring them to the same range. And as the standard(VC1) says, this factor can only be 2(thats y i guess this range from 0-255 gets altered to 64-191). Then y the registry setting has been provided for values upto 8. These registry values,i guess, are supposed to be used at the time of encoding only as decoding is independent of the registry values. At the time of encoding itself, is there any range expansion after range reduction? If not why is the expansion factor given? Also, as the standard goes, if the range reduction is done for luma, it must also be there for chroma with the same factor(2). Is this exactly range reduction or is it range mapping, in which case the flag is 3 bits and it can take values from 0 to 7? Range mapping is different from range reduction in that range reduction(or scaling up depending on the conditions) is done before predicting the next frame while range mapping(only in Advanced profile ) is done after loop filtering. Can anyone please clarify?

Thanks in advance.

bond
1st June 2006, 13:29
may i ask what range reduction does all in all?

zambelli
1st June 2006, 20:58
Here's an example of range reduction:
http://forum.doom9.org/showthread.php?p=835437#post835437

foxyshadis
1st June 2006, 21:40
It's like performing levels(0,1,255,64,192) or so, and then the reverse transform levels(64,1,192,0,255) on playback. (That is what 01010101 should mean, afaik.) Killing the color resolution and causing crazy banding for a minor compression gain sounds insane to me.

kiranrao
5th June 2006, 07:48
I'm able to generate only AP (WVC1) streams when i give the values to the '-v_rangeredux' parameter in the WMCmd.vbs file. How will i be able to generate the MP streams. If i give the codec version only as WVC1 it is working. Not working for WMV9. i.e. only range mapping is being done and not range reduction. Can anyone help?
Thanks in advance.

zambelli
5th June 2006, 18:08
I'm able to generate only AP (WVC1) streams when i give the values to the '-v_rangeredux' parameter in the WMCmd.vbs file. How will i be able to generate the MP streams. If i give the codec version only as WVC1 it is working. Not working for WMV9. i.e. only range mapping is being done and not range reduction. Can anyone help? Thanks in advance.
Correct - range reduction only works for Advanced Profile.

Sharktooth
5th June 2006, 18:42
why?!? you can do the same with an avs script and encode it with any profile (or a better codec :p )...

zambelli
5th June 2006, 19:05
why?!? you can do the same with an avs script and encode it with any profile (or a better codec :p )...
I double-checked and I was right: only Advanced Profile supports range reduction.

As for you suggestion... Compressing the range in preprocessing (i.e. avisynth) is not the problem. Expanding the range in decoding is something that needs to be designed on both encoding and decoding side, so there is definitely an advantage to having range reduction done by the codec.

bond
5th June 2006, 19:31
Here's an example of range reduction:
http://forum.doom9.org/showthread.php?p=835437#post835437hm thx for the link to your range reduction sample, zambelli, but you know that i cant encode the sample on my good ol windows 2000 ;)

can you attach the encoded .wmv samples somewhere?

why?!? you can do the same with an avs script and encode it with any profile (or a better codec :p )...how would such an avs script look like? and did you test how it works with x264? :D

bond
10th June 2006, 13:55
may i ask again whether its possible to do exactly the same effect range reduction in wmv9 does with avisynth?

or is range reduction also done on the decoding side? or only encoding?

akupenguin
10th June 2006, 19:01
It requires filtering on both encode and decode sides.

bond
10th June 2006, 19:10
:thanks:

Didée
10th June 2006, 20:05
Still you can simulate the process by Avisynth. The basic problem of range reduction + re-expansion is highly similar to what I talked about here (http://forum.doom9.org/showthread.php?p=709492#post709492), together with an easy small Avisynth script.
BTW, since when is range reduction is available in WMV? I hope that implementation of this feature didn't start after the 9th of September '05 ... :scared:

zambelli
10th June 2006, 22:04
BTW, since when is range reduction is available in WMV? I hope that implementation of this feature didn't start after the 9th of September '05 ... :scared:
LOL... Since VC-1 spec was submitted to SMPTE in 2003. :)