Skip to content

Commit a389ab5

Browse files
JeromeMartinezdericed
authored andcommitted
JPEG2000-RCT formula update
In order to be compatible with files in the wild
1 parent 6467005 commit a389ab5

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

ffv1.md

+36-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ with:
187187
- top16s = top >= 32768 ? ( top - 65536 ) : top
188188
- diag16s = diag >= 32768 ? ( diag - 65536 ) : diag
189189

190-
Background: a two's complement signed 16-bit signed integer was used for storing pixel values in all known implementations of FFV1 bitstream. So in some circumstances, the most significant bit was wrongly interpreted (used as a sign bit instead of the 16th bit of an unsigned integer). Note that when the issue is discovered, the only configuration of all known implementations being impacted is 16-bit YCbCr color space with Range Coder coder, as other potentially impacted configurations (e.g. 15/16-bit JPEG2000-RCT color space with Range Coder coder, or 16-bit any color space with Golomb Rice coder) were implemented nowhere. In the meanwhile, 16-bit JPEG2000-RCT color space with Range Coder coder was implemented without this issue in one implementation and validated by one conformance checker. It is expected (to be confirmed) to remove this exception for the media predictor in the next version of the bitstream.
190+
Background: a two's complement signed 16-bit signed integer was used for storing pixel values in all known implementations of FFV1 bitstream. So in some circumstances, the most significant bit was wrongly interpreted (used as a sign bit instead of the 16th bit of an unsigned integer). Note that when the issue is discovered, the only configuration of all known implementations being impacted is 16-bit YCbCr color space with Range Coder coder, as other potentially impacted configurations (e.g. 15/16-bit JPEG2000-RCT color space with Range Coder coder, or 16-bit any color space with Golomb Rice coder) were implemented nowhere. In the meanwhile, 16-bit JPEG2000-RCT color space with Range Coder coder was implemented without this issue in one implementation and validated by one conformance checker. Methods to address this exception for the transform are under consideration for the next version of the bitstream.
191191

192192
## Context
193193

@@ -272,6 +272,41 @@ RFC:```
272272
RFC:b=Cb+g
273273
RFC:```
274274

275+
Exception for the reversible conversions between YCbCr and RGB:
276+
if bits_per_raw_sample is between 9 and 15 inclusive, the following formulae for reversible conversions between YCbCr and RGB MUST be used instead of the ones above:
277+
278+
PDF:$$Cb=g-b$$
279+
RFC:```
280+
RFC:Cb=g-b
281+
RFC:```
282+
283+
PDF:$$Cr=r-b$$
284+
RFC:```
285+
RFC:Cr=r-b
286+
RFC:```
287+
288+
PDF:$$Y=b+(Cb+Cr)>>2$$
289+
RFC:```
290+
RFC:Y=b+(Cb+Cr)>>2
291+
RFC:```
292+
293+
PDF:$$b=Y-(Cb+Cr)>>2$$
294+
RFC:```
295+
RFC:b=Y-(Cb+Cr)>>2
296+
RFC:```
297+
298+
PDF:$$r=Cr+b$$
299+
RFC:```
300+
RFC:r=Cr+b
301+
RFC:```
302+
303+
PDF:$$g=Cb+b$$
304+
RFC:```
305+
RFC:g=Cb+b
306+
RFC:```
307+
308+
Background: At the time of this writing, in all known implementations of FFV1 bitstream, when bits_per_raw_sample was between 9 and 15 inclusive, GBR planes were used as BGR planes during both encoding and decoding. In the meanwhile, 16-bit JPEG2000-RCT color space was implemented without this issue in one implementation and validated by one conformance checker. It is expected (to be confirmed) to remove this exception for the transform in the next version of the bitstream.
309+
275310
[@!ISO.15444-1.2016]
276311

277312
An FFV1 frame using JPEG2000-RCT MUST use one of the following arrangements:

0 commit comments

Comments
 (0)