46 LOGDEBUG(
"Stream: %02x %02x %02x %02x %02x %02x %02x %02x %02x "
47 "%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x "
48 "%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x size %d",
49 data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8],
50 data[9], data[10], data[11], data[12], data[13], data[14], data[15], data[16], data[17],
51 data[18], data[19], data[20], data[21], data[22], data[23], data[24], data[25], data[26],
52 data[27], data[28], data[29], data[30], data[31], data[32], data[33], data[34], size);
83 for (i = 0; i <
m_pAvpkt->size - 3; i++) {
113 for (i = 0; i <
m_pAvpkt->size - 4; i++) {
132 int frameCropLeftOffset = 0;
133 int frameCropRightOffset = 0;
134 int frameCropTopOffset = 0;
135 int frameCropBottomOffset = 0;
136 int chromaFormatIdc = 0;
137 int separateColorPlaneFlag = 0;
143 if (profileIdc == 100 || profileIdc == 110 ||
144 profileIdc == 122 || profileIdc == 244 ||
145 profileIdc == 44 || profileIdc == 83 ||
146 profileIdc == 86 || profileIdc == 118) {
149 if (chromaFormatIdc == 3)
150 separateColorPlaneFlag =
ReadBit();
154 int seqScalingMatrixPresentFlag =
ReadBit();
155 if (seqScalingMatrixPresentFlag) {
156 for (
int i = 0; i < 8; i++) {
157 int seqScalingListPresentFlag =
ReadBit();
158 if (seqScalingListPresentFlag) {
159 int sizeOfScalingList = (i < 6) ? 16 : 64;
162 for (
int j = 0; j < sizeOfScalingList; j++) {
163 if (nextScale != 0) {
164 int delta_scale =
ReadSE();
165 nextScale = (lastScale + delta_scale + 256) % 256;
167 lastScale = (nextScale == 0) ? lastScale : nextScale;
175 if (picOrderCntType == 0) {
177 }
else if (picOrderCntType == 1) {
182 for (
int i = 0; i < numRefFramesInPicOrderCntCycle; i++ ) {
190 int frameMbsOnlyFlag =
ReadBit();
191 if (!frameMbsOnlyFlag) {
196 int frameCroppingFlag =
ReadBit();
197 if (frameCroppingFlag) {
207 if (chromaFormatIdc == 0 && separateColorPlaneFlag == 0) {
208 subWidthC = subHeightC = 2;
209 }
else if (chromaFormatIdc == 1 && separateColorPlaneFlag == 0) {
210 subWidthC = subHeightC = 2;
211 }
else if (chromaFormatIdc == 2 && separateColorPlaneFlag == 0) {
214 }
else if (chromaFormatIdc == 3) {
215 if (separateColorPlaneFlag == 0) {
216 subWidthC = subHeightC = 1;
217 }
else if (separateColorPlaneFlag == 1) {
218 subWidthC = subHeightC = 0;
222 m_width = ((picWidthInMbsMinusOne + 1) * 16) -
223 subWidthC * (frameCropRightOffset + frameCropLeftOffset);
225 m_height = ((2 - frameMbsOnlyFlag)* (picHeightInMapUnitsMinusOne +1) * 16) -
226 subHeightC * ((frameCropBottomOffset * 2) + (frameCropTopOffset * 2));
228 LOGDEBUG2(
L_CODEC,
"H264Parser: %s %s%s%s%s%s%s width %d height %d", __FUNCTION__,
bool isValidStartCode(const uint8_t *data, int offset)
Returns true, if we have a 0x000001 start code in data at the offset position.