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 { ...@@ -101,6 +101,9 @@ public final class NalUnitUtil {
public final boolean generalTierFlag; public final boolean generalTierFlag;
public final int generalProfileIdc; public final int generalProfileIdc;
public final int generalProfileCompatibilityFlags; public final int generalProfileCompatibilityFlags;
public final int chromaFormatIdc;
public final int bitDepthLumaMinus8;
public final int bitDepthChromaMinus8;
public final int[] constraintBytes; public final int[] constraintBytes;
public final int generalLevelIdc; public final int generalLevelIdc;
public final int seqParameterSetId; public final int seqParameterSetId;
...@@ -116,6 +119,9 @@ public final class NalUnitUtil { ...@@ -116,6 +119,9 @@ public final class NalUnitUtil {
boolean generalTierFlag, boolean generalTierFlag,
int generalProfileIdc, int generalProfileIdc,
int generalProfileCompatibilityFlags, int generalProfileCompatibilityFlags,
int chromaFormatIdc,
int bitDepthLumaMinus8,
int bitDepthChromaMinus8,
int[] constraintBytes, int[] constraintBytes,
int generalLevelIdc, int generalLevelIdc,
int seqParameterSetId, int seqParameterSetId,
...@@ -129,6 +135,9 @@ public final class NalUnitUtil { ...@@ -129,6 +135,9 @@ public final class NalUnitUtil {
this.generalTierFlag = generalTierFlag; this.generalTierFlag = generalTierFlag;
this.generalProfileIdc = generalProfileIdc; this.generalProfileIdc = generalProfileIdc;
this.generalProfileCompatibilityFlags = generalProfileCompatibilityFlags; this.generalProfileCompatibilityFlags = generalProfileCompatibilityFlags;
this.chromaFormatIdc = chromaFormatIdc;
this.bitDepthLumaMinus8 = bitDepthLumaMinus8;
this.bitDepthChromaMinus8 = bitDepthChromaMinus8;
this.constraintBytes = constraintBytes; this.constraintBytes = constraintBytes;
this.generalLevelIdc = generalLevelIdc; this.generalLevelIdc = generalLevelIdc;
this.seqParameterSetId = seqParameterSetId; this.seqParameterSetId = seqParameterSetId;
...@@ -546,8 +555,8 @@ public final class NalUnitUtil { ...@@ -546,8 +555,8 @@ public final class NalUnitUtil {
frameWidth -= subWidthC * (confWinLeftOffset + confWinRightOffset); frameWidth -= subWidthC * (confWinLeftOffset + confWinRightOffset);
frameHeight -= subHeightC * (confWinTopOffset + confWinBottomOffset); frameHeight -= subHeightC * (confWinTopOffset + confWinBottomOffset);
} }
data.readUnsignedExpGolombCodedInt(); // bit_depth_luma_minus8 int bitDepthLumaMinus8 = data.readUnsignedExpGolombCodedInt();
data.readUnsignedExpGolombCodedInt(); // bit_depth_chroma_minus8 int bitDepthChromaMinus8 = data.readUnsignedExpGolombCodedInt();
int log2MaxPicOrderCntLsbMinus4 = data.readUnsignedExpGolombCodedInt(); int log2MaxPicOrderCntLsbMinus4 = data.readUnsignedExpGolombCodedInt();
// for (i = sps_sub_layer_ordering_info_present_flag ? 0 : sps_max_sub_layers_minus1; ...) // 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++) { for (int i = data.readBit() ? 0 : maxSubLayersMinus1; i <= maxSubLayersMinus1; i++) {
...@@ -634,6 +643,9 @@ public final class NalUnitUtil { ...@@ -634,6 +643,9 @@ public final class NalUnitUtil {
generalTierFlag, generalTierFlag,
generalProfileIdc, generalProfileIdc,
generalProfileCompatibilityFlags, generalProfileCompatibilityFlags,
chromaFormatIdc,
bitDepthLumaMinus8,
bitDepthChromaMinus8,
constraintBytes, constraintBytes,
generalLevelIdc, generalLevelIdc,
seqParameterSetId, 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