Commit 04e007bf by sheenachhabra Committed by Ian Baker

Read H265 profile info from CSD-0 data

To set the chroma format and depth information for H265 format,the csd-0 data
needs to be parsed. The previous implementation skipped parsing
csd-0 data and hard coded values based on "profile" field in MediaFormat.

Along with above mention changes, corrected some of the comments
as per spec.

PiperOrigin-RevId: 522335595
parent d31ff0f9
......@@ -101,6 +101,9 @@ public final class NalUnitUtil {
public final boolean generalTierFlag;
public final int generalProfileIdc;
public final int generalProfileCompatibilityFlags;
public final int chromaFormatIdc;
public final int bitDepthLumaMinus8;
public final int bitDepthChromaMinus8;
public final int[] constraintBytes;
public final int generalLevelIdc;
public final int seqParameterSetId;
......@@ -116,6 +119,9 @@ public final class NalUnitUtil {
boolean generalTierFlag,
int generalProfileIdc,
int generalProfileCompatibilityFlags,
int chromaFormatIdc,
int bitDepthLumaMinus8,
int bitDepthChromaMinus8,
int[] constraintBytes,
int generalLevelIdc,
int seqParameterSetId,
......@@ -129,6 +135,9 @@ public final class NalUnitUtil {
this.generalTierFlag = generalTierFlag;
this.generalProfileIdc = generalProfileIdc;
this.generalProfileCompatibilityFlags = generalProfileCompatibilityFlags;
this.chromaFormatIdc = chromaFormatIdc;
this.bitDepthLumaMinus8 = bitDepthLumaMinus8;
this.bitDepthChromaMinus8 = bitDepthChromaMinus8;
this.constraintBytes = constraintBytes;
this.generalLevelIdc = generalLevelIdc;
this.seqParameterSetId = seqParameterSetId;
......@@ -546,8 +555,8 @@ public final class NalUnitUtil {
frameWidth -= subWidthC * (confWinLeftOffset + confWinRightOffset);
frameHeight -= subHeightC * (confWinTopOffset + confWinBottomOffset);
}
data.readUnsignedExpGolombCodedInt(); // bit_depth_luma_minus8
data.readUnsignedExpGolombCodedInt(); // bit_depth_chroma_minus8
int bitDepthLumaMinus8 = data.readUnsignedExpGolombCodedInt();
int bitDepthChromaMinus8 = data.readUnsignedExpGolombCodedInt();
int log2MaxPicOrderCntLsbMinus4 = data.readUnsignedExpGolombCodedInt();
// for (i = sps_sub_layer_ordering_info_present_flag ? 0 : sps_max_sub_layers_minus1; ...)
for (int i = data.readBit() ? 0 : maxSubLayersMinus1; i <= maxSubLayersMinus1; i++) {
......@@ -634,6 +643,9 @@ public final class NalUnitUtil {
generalTierFlag,
generalProfileIdc,
generalProfileCompatibilityFlags,
chromaFormatIdc,
bitDepthLumaMinus8,
bitDepthChromaMinus8,
constraintBytes,
generalLevelIdc,
seqParameterSetId,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment