Commit b82deac2 authored by Khaled Mammou's avatar Khaled Mammou Committed by David Flynn
Browse files

support 16b to 8b reflectance conversion by scaling src/output values

Certain test sequences with 16-bit reflectance are actually 8-bit data that
has been scaled by 255.  This commit adds non-normative support to the
encoder and decoder to convert between the two representations through
the option "hack.reflectanceScale".
parent 82244d14
......@@ -17,10 +17,14 @@ categories:
####
# attribute coding (common options -- relies on option ordering)
# - use lifting transform for lossy conditions
# - scale 16bit reflectance data to 8bit
# - automatically derive dist2 based on single initial value by the encoder:
# - the initial dist2 is scaled by positionQuantisationScale
# - generates dist2 per lod
- colorTransform: 1
-
- !conditional '${reflectance8b16b_scale_factor}'
- hack.reflectanceScale: ${reflectance8b16b_scale_factor}
- transformType: 2
- numberOfNearestNeighborsInPrediction: 3
- levelOfDetailCount: ${seq_lod}
......@@ -31,43 +35,46 @@ categories:
# attribute coding -- reflectance
-
- !conditional '${has_refl}'
- adaptivePredictionThreshold: '$eval{ 1 << (${bitdepth_refl} - 2) }'
- adaptivePredictionThreshold: '$eval{ 1 << (8 - 2) }'
- quantizationStepLuma:
r01: '$eval{ 256 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r02: '$eval{ 128 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r03: '$eval{ 64 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r04: '$eval{ 32 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r05: '$eval{ 16 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r06: '$eval{ 8 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r01: 256
r02: 128
r03: 64
r04: 32
r05: 16
r06: 8
- quantizationStepChroma: 0
- bitdepth: ${bitdepth_refl}
- bitdepth: 8
- attribute: reflectance
##
# attribute coding -- colour
-
- !conditional '${has_colour}'
- adaptivePredictionThreshold: '$eval{ 1 << (${bitdepth_colour} - 2) }'
- adaptivePredictionThreshold: '$eval{ 1 << (8 - 2) }'
- quantizationStepLuma:
r01: '$eval{ 256 * (1 << (${bitdepth_colour} - 8)) }'
r02: '$eval{ 128 * (1 << (${bitdepth_colour} - 8)) }'
r03: '$eval{ 64 * (1 << (${bitdepth_colour} - 8)) }'
r04: '$eval{ 32 * (1 << (${bitdepth_colour} - 8)) }'
r05: '$eval{ 16 * (1 << (${bitdepth_colour} - 8)) }'
r06: '$eval{ 8 * (1 << (${bitdepth_colour} - 8)) }'
r01: 256
r02: 128
r03: 64
r04: 32
r05: 16
r06: 8
- quantizationStepChroma:
r01: '$eval{ 256 * (1 << (${bitdepth_colour} - 8)) }'
r02: '$eval{ 128 * (1 << (${bitdepth_colour} - 8)) }'
r03: '$eval{ 64 * (1 << (${bitdepth_colour} - 8)) }'
r04: '$eval{ 32 * (1 << (${bitdepth_colour} - 8)) }'
r05: '$eval{ 16 * (1 << (${bitdepth_colour} - 8)) }'
r06: '$eval{ 8 * (1 << (${bitdepth_colour} - 8)) }'
- bitdepth: ${bitdepth_colour}
r01: 256
r02: 128
r03: 64
r04: 32
r05: 16
r06: 8
- bitdepth: 8
- attribute: color
decflags:
- mode: 1
- colorTransform: 1
-
- !conditional '${reflectance8b16b_scale_factor}'
- hack.reflectanceScale: ${reflectance8b16b_scale_factor}
pcerrorflags:
- dropdups: 2
......
......@@ -23,6 +23,7 @@ categories:
# attribute coding (common options -- relies on option ordering)
# - skip attribute coding if dist2 parameters are not defined
# -- this may seem odd, but is required for lossy-geom data
# - scale 16bit reflectance data to 8bit
# - use lifting transform for lossy conditions
# - automatically derive dist2 based on single initial value by the encoder:
# - the initial dist2 is scaled by positionQuantisationScale
......@@ -30,6 +31,9 @@ categories:
-
- !conditional 'defined ${seq_lod} && defined ${seq_dist2}'
- colorTransform: 1
-
- !conditional '${reflectance8b16b_scale_factor}'
- hack.reflectanceScale: ${reflectance8b16b_scale_factor}
- transformType: 2
- numberOfNearestNeighborsInPrediction: 3
- levelOfDetailCount: ${seq_lod}
......@@ -40,43 +44,46 @@ categories:
# attribute coding -- reflectance
-
- !conditional '${has_refl}'
- adaptivePredictionThreshold: '$eval{ 1 << (${bitdepth_refl} - 2) }'
- adaptivePredictionThreshold: '$eval{ 1 << (8 - 2) }'
- quantizationStepLuma:
r01: '$eval{ 256 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r02: '$eval{ 128 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r03: '$eval{ 64 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r04: '$eval{ 32 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r05: '$eval{ 16 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r06: '$eval{ 8 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r01: 256
r02: 128
r03: 64
r04: 32
r05: 16
r06: 8
- quantizationStepChroma: 0
- bitdepth: ${bitdepth_refl}
- bitdepth: 8
- attribute: reflectance
##
# attribute coding -- colour
-
- !conditional '${has_colour}'
- adaptivePredictionThreshold: '$eval{ 1 << (${bitdepth_colour} - 2) }'
- adaptivePredictionThreshold: '$eval{ 1 << (8 - 2) }'
- quantizationStepLuma:
r01: '$eval{ 256 * (1 << (${bitdepth_colour} - 8)) }'
r02: '$eval{ 128 * (1 << (${bitdepth_colour} - 8)) }'
r03: '$eval{ 64 * (1 << (${bitdepth_colour} - 8)) }'
r04: '$eval{ 32 * (1 << (${bitdepth_colour} - 8)) }'
r05: '$eval{ 16 * (1 << (${bitdepth_colour} - 8)) }'
r06: '$eval{ 8 * (1 << (${bitdepth_colour} - 8)) }'
r01: 256
r02: 128
r03: 64
r04: 32
r05: 16
r06: 8
- quantizationStepChroma:
r01: '$eval{ 256 * (1 << (${bitdepth_colour} - 8)) }'
r02: '$eval{ 128 * (1 << (${bitdepth_colour} - 8)) }'
r03: '$eval{ 64 * (1 << (${bitdepth_colour} - 8)) }'
r04: '$eval{ 32 * (1 << (${bitdepth_colour} - 8)) }'
r05: '$eval{ 16 * (1 << (${bitdepth_colour} - 8)) }'
r06: '$eval{ 8 * (1 << (${bitdepth_colour} - 8)) }'
- bitdepth: ${bitdepth_colour}
r01: 256
r02: 128
r03: 64
r04: 32
r05: 16
r06: 8
- bitdepth: 8
- attribute: color
decflags:
- mode: 1
- colorTransform: 1
-
- !conditional '${reflectance8b16b_scale_factor}'
- hack.reflectanceScale: ${reflectance8b16b_scale_factor}
pcerrorflags:
- dropdups: 2
......
......@@ -20,6 +20,7 @@ categories:
# - skip attribute coding if dist2 parameters are not defined
# -- this may seem odd, but is required for lossy-geom data
# - avoid measuring loss of colourspace conversion
# - scale 16bit reflectance data to 8bit
# - use predicting transform for lossless conditions
# - automatically derive dist2 based on single initial value by the encoder:
# - the initial dist2 is scaled by positionQuantisationScale
......@@ -27,6 +28,9 @@ categories:
-
- !conditional 'defined ${seq_lod} && defined ${seq_dist2}'
- colorTransform: 0
-
- !conditional '${reflectance8b16b_scale_factor}'
- hack.reflectanceScale: ${reflectance8b16b_scale_factor}
- transformType: 0
- numberOfNearestNeighborsInPrediction: 3
- levelOfDetailCount: ${seq_lod}
......@@ -37,25 +41,28 @@ categories:
# attribute coding -- reflectance
-
- !conditional '${has_refl}'
- adaptivePredictionThreshold: '$eval{ 1 << (${bitdepth_refl} - 2) }'
- adaptivePredictionThreshold: '$eval{ 1 << (8 - 2) }'
- quantizationStepLuma: 0
- quantizationStepChroma: 0
- bitdepth: ${bitdepth_refl}
- bitdepth: 8
- attribute: reflectance
##
# attribute coding -- colour
-
- !conditional '${has_colour}'
- adaptivePredictionThreshold: '$eval{ 1 << (${bitdepth_colour} - 2) }'
- adaptivePredictionThreshold: '$eval{ 1 << (8 - 2) }'
- quantizationStepLuma: 0
- quantizationStepChroma: 0
- bitdepth: ${bitdepth_colour}
- bitdepth: 8
- attribute: color
decflags:
- mode: 1
- colorTransform: 0
-
- !conditional '${reflectance8b16b_scale_factor}'
- hack.reflectanceScale: ${reflectance8b16b_scale_factor}
pcerrorflags:
- dropdups: 2
......
......@@ -18,11 +18,15 @@ categories:
####
# attribute coding (common options -- relies on option ordering)
# - avoid measuring loss of colourspace conversion
# - scale 16bit reflectance data to 8bit
# - use predicting transform for lossless conditions
# - automatically derive dist2 based on single initial value by the encoder:
# - the initial dist2 is scaled by positionQuantisationScale
# - generates dist2 per lod
- colorTransform: 0
-
- !conditional '${reflectance8b16b_scale_factor}'
- hack.reflectanceScale: ${reflectance8b16b_scale_factor}
- transformType: 0
- numberOfNearestNeighborsInPrediction: 3
- levelOfDetailCount: ${seq_lod}
......@@ -33,40 +37,43 @@ categories:
# attribute coding -- reflectance
-
- !conditional '${has_refl}'
- adaptivePredictionThreshold: '$eval{ 1 << (${bitdepth_refl} - 2) }'
- adaptivePredictionThreshold: '$eval{ 1 << (8 - 2) }'
- quantizationStepLuma:
r01: '$eval{ 2 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r02: '$eval{ 4 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r03: '$eval{ 8 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r04: '$eval{ 16 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r05: '$eval{ 32 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r01: 2
r02: 4
r03: 8
r04: 16
r05: 32
- quantizationStepChroma: 0
- bitdepth: ${bitdepth_refl}
- bitdepth: 8
- attribute: reflectance
##
# attribute coding -- colour
-
- !conditional '${has_colour}'
- adaptivePredictionThreshold: '$eval{ 1 << (${bitdepth_colour} - 2) }'
- adaptivePredictionThreshold: '$eval{ 1 << (8 - 2) }'
- quantizationStepLuma:
r01: '$eval{ 2 * (1 << (${bitdepth_colour} - 8)) }'
r02: '$eval{ 4 * (1 << (${bitdepth_colour} - 8)) }'
r03: '$eval{ 8 * (1 << (${bitdepth_colour} - 8)) }'
r04: '$eval{ 16 * (1 << (${bitdepth_colour} - 8)) }'
r05: '$eval{ 32 * (1 << (${bitdepth_colour} - 8)) }'
r01: 2
r02: 4
r03: 8
r04: 16
r05: 32
- quantizationStepChroma:
r01: '$eval{ 2 * (1 << (${bitdepth_colour} - 8)) }'
r02: '$eval{ 4 * (1 << (${bitdepth_colour} - 8)) }'
r03: '$eval{ 8 * (1 << (${bitdepth_colour} - 8)) }'
r04: '$eval{ 16 * (1 << (${bitdepth_colour} - 8)) }'
r05: '$eval{ 32 * (1 << (${bitdepth_colour} - 8)) }'
- bitdepth: ${bitdepth_colour}
r01: 2
r02: 4
r03: 8
r04: 16
r05: 32
- bitdepth: 8
- attribute: color
decflags:
- mode: 1
- colorTransform: 0
-
- !conditional '${reflectance8b16b_scale_factor}'
- hack.reflectanceScale: ${reflectance8b16b_scale_factor}
pcerrorflags:
- dropdups: 2
......
......@@ -17,7 +17,11 @@ categories:
####
# attribute coding (common options -- relies on option ordering)
# - uses raht transform
# - scale 16bit reflectance data to 8bit
- colorTransform: 1
-
- !conditional '${reflectance8b16b_scale_factor}'
- hack.reflectanceScale: ${reflectance8b16b_scale_factor}
- transformType: 1
##
......@@ -26,14 +30,14 @@ categories:
- !conditional '${has_refl}'
- rahtLeafDecimationDepth: 0
- quantizationStepLuma:
r01: '$eval{ 256 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r02: '$eval{ 128 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r03: '$eval{ 64 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r04: '$eval{ 32 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r05: '$eval{ 16 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r06: '$eval{ 8 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r01: 256
r02: 128
r03: 64
r04: 32
r05: 16
r06: 8
- quantizationStepChroma: 0
- bitdepth: ${bitdepth_refl}
- bitdepth: 8
- attribute: reflectance
##
......@@ -42,26 +46,29 @@ categories:
- !conditional '${has_colour}'
- rahtLeafDecimationDepth: 0
- quantizationStepLuma:
r01: '$eval{ 256 * (1 << (${bitdepth_colour} - 8)) }'
r02: '$eval{ 128 * (1 << (${bitdepth_colour} - 8)) }'
r03: '$eval{ 64 * (1 << (${bitdepth_colour} - 8)) }'
r04: '$eval{ 32 * (1 << (${bitdepth_colour} - 8)) }'
r05: '$eval{ 16 * (1 << (${bitdepth_colour} - 8)) }'
r06: '$eval{ 8 * (1 << (${bitdepth_colour} - 8)) }'
r01: 256
r02: 128
r03: 64
r04: 32
r05: 16
r06: 8
- quantizationStepChroma:
# NB: raht doesn't yet support quantizationStepChroma
r01: '$eval{ 256 * (1 << (${bitdepth_colour} - 8)) }'
r02: '$eval{ 128 * (1 << (${bitdepth_colour} - 8)) }'
r03: '$eval{ 64 * (1 << (${bitdepth_colour} - 8)) }'
r04: '$eval{ 32 * (1 << (${bitdepth_colour} - 8)) }'
r05: '$eval{ 16 * (1 << (${bitdepth_colour} - 8)) }'
r06: '$eval{ 8 * (1 << (${bitdepth_colour} - 8)) }'
- bitdepth: ${bitdepth_colour}
r01: 256
r02: 128
r03: 64
r04: 32
r05: 16
r06: 8
- bitdepth: 8
- attribute: color
decflags:
- mode: 1
- colorTransform: 1
-
- !conditional '${reflectance8b16b_scale_factor}'
- hack.reflectanceScale: ${reflectance8b16b_scale_factor}
pcerrorflags:
- dropdups: 2
......
......@@ -22,7 +22,11 @@ categories:
####
# attribute coding (common options -- relies on option ordering)
# - use raht
# - scale 16bit reflectance data to 8bit
- colorTransform: 1
-
- !conditional '${reflectance8b16b_scale_factor}'
- hack.reflectanceScale: ${reflectance8b16b_scale_factor}
- transformType: 1
##
......@@ -31,14 +35,14 @@ categories:
- !conditional '${has_refl}'
- rahtLeafDecimationDepth: 0
- quantizationStepLuma:
r01: '$eval{ 256 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r02: '$eval{ 128 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r03: '$eval{ 64 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r04: '$eval{ 32 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r05: '$eval{ 16 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r06: '$eval{ 8 * (${scale_refl} ? ${scale_refl} : (1 << (${bitdepth_refl} - 8))) }'
r01: 256
r02: 128
r03: 64
r04: 32
r05: 16
r06: 8
- quantizationStepChroma: 0
- bitdepth: ${bitdepth_refl}
- bitdepth: 8
- attribute: reflectance
##
......@@ -47,26 +51,29 @@ categories:
- !conditional '${has_colour}'
- rahtLeafDecimationDepth: 0
- quantizationStepLuma:
r01: '$eval{ 256 * (1 << (${bitdepth_colour} - 8)) }'
r02: '$eval{ 128 * (1 << (${bitdepth_colour} - 8)) }'
r03: '$eval{ 64 * (1 << (${bitdepth_colour} - 8)) }'
r04: '$eval{ 32 * (1 << (${bitdepth_colour} - 8)) }'
r05: '$eval{ 16 * (1 << (${bitdepth_colour} - 8)) }'
r06: '$eval{ 8 * (1 << (${bitdepth_colour} - 8)) }'
r01: 256
r02: 128
r03: 64
r04: 32
r05: 16
r06: 8
- quantizationStepChroma:
# NB: raht doesn't yet support quantizationStepChroma
r01: '$eval{ 256 * (1 << (${bitdepth_colour} - 8)) }'
r02: '$eval{ 128 * (1 << (${bitdepth_colour} - 8)) }'
r03: '$eval{ 64 * (1 << (${bitdepth_colour} - 8)) }'
r04: '$eval{ 32 * (1 << (${bitdepth_colour} - 8)) }'
r05: '$eval{ 16 * (1 << (${bitdepth_colour} - 8)) }'
r06: '$eval{ 8 * (1 << (${bitdepth_colour} - 8)) }'
- bitdepth: ${bitdepth_colour}
r01: 256
r02: 128
r03: 64
r04: 32
r05: 16
r06: 8
- bitdepth: 8
- attribute: color
decflags:
- mode: 1
- colorTransform: 1
-
- !conditional '${reflectance8b16b_scale_factor}'
- hack.reflectanceScale: ${reflectance8b16b_scale_factor}
pcerrorflags:
- dropdups: 2
......
......@@ -13,6 +13,7 @@ sequences:
has_colour: 1
bitdepth_refl: 16
bitdepth_colour: 8
reflectance8b16b_scale_factor: 255
pcerrorflags:
- resolution: 30000
......@@ -27,6 +28,7 @@ sequences:
has_colour: 1
bitdepth_refl: 16
bitdepth_colour: 8
reflectance8b16b_scale_factor: 255
pcerrorflags:
- resolution: 30000
......@@ -41,6 +43,7 @@ sequences:
has_colour: 1
bitdepth_refl: 16
bitdepth_colour: 8
reflectance8b16b_scale_factor: 255
pcerrorflags:
- resolution: 30000
......
......@@ -37,22 +37,22 @@ categories:
# attribute coding -- colour
-
- !conditional '${has_colour}'
- adaptivePredictionThreshold: '$eval{ 1 << (${bitdepth_colour} - 2) }'
- adaptivePredictionThreshold: '$eval{ 1 << (8 - 2) }'
- quantizationStepLuma:
r01: '$eval{ 256 * (1 << (${bitdepth_colour} - 8)) }'
r02: '$eval{ 128 * (1 << (${bitdepth_colour} - 8)) }'
r03: '$eval{ 64 * (1 << (${bitdepth_colour} - 8)) }'
r04: '$eval{ 32 * (1 << (${bitdepth_colour} - 8)) }'
r05: '$eval{ 16 * (1 << (${bitdepth_colour} - 8)) }'
r06: '$eval{ 8 * (1 << (${bitdepth_colour} - 8)) }'
r01: 256
r02: 128
r03: 64
r04: 32
r05: 16
r06: 8
- quantizationStepChroma:
r01: '$eval{ 256 * (1 << (${bitdepth_colour} - 8)) }'
r02: '$eval{ 128 * (1 << (${bitdepth_colour} - 8)) }'
r03: '$eval{ 64 * (1 << (${bitdepth_colour} - 8)) }'
r04: '$eval{ 32 * (1 << (${bitdepth_colour} - 8)) }'
r05: '$eval{ 16 * (1 << (${bitdepth_colour} - 8)) }'
r06: '$eval{ 8 * (1 << (${bitdepth_colour} - 8)) }'
- bitdepth: ${bitdepth_colour}
r01: 256
r02: 128
r03: 64
r04: 32
r05: 16
r06: 8
- bitdepth: 8
- attribute: color
decflags:
......
......@@ -32,21 +32,21 @@ categories:
- !conditional '${has_colour}'
- rahtLeafDecimationDepth: 0
- quantizationStepLuma:
r01: '$eval{ 256 * (1 << (${bitdepth_colour} - 8)) }'
r02: '$eval{ 128 * (1 << (${bitdepth_colour}