Change VVC stream type in HDMV descriptor
Plus various tidying-up in VVC files.
This commit is contained in:
parent
0607373ec6
commit
1adb7b7cc7
@ -437,7 +437,7 @@ int VvcVpsUnit::deserialize()
|
||||
void VvcVpsUnit::setFPS(double fps)
|
||||
{
|
||||
time_scale = (uint32_t)(fps + 0.5) * 1000000;
|
||||
num_units_in_tick = time_scale / fps + 0.5;
|
||||
num_units_in_tick = (int)(time_scale / fps + 0.5);
|
||||
|
||||
// num_units_in_tick = time_scale/2 / fps;
|
||||
assert(num_units_in_tick_bit_pos > 0);
|
||||
@ -536,13 +536,13 @@ int VvcSpsUnit::deserialize()
|
||||
if (!sps_subpic_same_size_flag || i == 0)
|
||||
{
|
||||
if (i != 0 && pic_width_max_in_luma_samples > CtbSizeY)
|
||||
m_reader.skipBits(ceil(log2(tmpWidthVal))); // sps_subpic_ctu_top_left_x[i]
|
||||
m_reader.skipBits((unsigned)ceil(log2(tmpWidthVal))); // sps_subpic_ctu_top_left_x[i]
|
||||
if (i != 0 && pic_height_max_in_luma_samples > CtbSizeY)
|
||||
m_reader.skipBits(ceil(log2(tmpHeightVal))); // sps_subpic_ctu_top_left_y[i]
|
||||
m_reader.skipBits((unsigned)ceil(log2(tmpHeightVal))); // sps_subpic_ctu_top_left_y[i]
|
||||
if (i < sps_num_subpics_minus1 && pic_width_max_in_luma_samples > CtbSizeY)
|
||||
m_reader.skipBits(ceil(log2(tmpWidthVal))); // sps_subpic_width_minus1[i]
|
||||
m_reader.skipBits((unsigned)ceil(log2(tmpWidthVal))); // sps_subpic_width_minus1[i]
|
||||
if (i < sps_num_subpics_minus1 && pic_height_max_in_luma_samples > CtbSizeY)
|
||||
m_reader.skipBits(ceil(log2(tmpHeightVal))); // sps_subpic_height_minus1[i]
|
||||
m_reader.skipBits((unsigned)ceil(log2(tmpHeightVal))); // sps_subpic_height_minus1[i]
|
||||
}
|
||||
if (!sps_independent_subpics_flag)
|
||||
m_reader.skipBits(
|
||||
@ -724,7 +724,7 @@ int VvcSpsUnit::deserialize()
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (extractUEGolombCode() > CtbLog2SizeY - 2) // sps_log2_parallel_merge_level_minus2
|
||||
if (extractUEGolombCode() + 2 > (unsigned)CtbLog2SizeY) // sps_log2_parallel_merge_level_minus2
|
||||
return 1;
|
||||
|
||||
m_reader.skipBits(3); // sps_isp_enabled_flag, sps_mrl_enabled_flag, sps_mip_enabled_flag
|
||||
@ -757,7 +757,7 @@ int VvcSpsUnit::deserialize()
|
||||
int sps_ladf_qp_offset = extractSEGolombCode();
|
||||
if (sps_ladf_qp_offset < -63 || sps_ladf_qp_offset > 63)
|
||||
return 1;
|
||||
if (extractUEGolombCode() > (1 << (bitdepth_minus8 + 8)) - 3) // sps_ladf_delta_threshold_minus1
|
||||
if (extractUEGolombCode() > (1U << (bitdepth_minus8 + 8)) - 3) // sps_ladf_delta_threshold_minus1
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@ -774,7 +774,7 @@ int VvcSpsUnit::deserialize()
|
||||
if (m_reader.getBit()) // sps_virtual_boundaries_present_flag
|
||||
{
|
||||
unsigned sps_num_ver_virtual_boundaries = extractUEGolombCode();
|
||||
if (sps_num_ver_virtual_boundaries > (pic_width_max_in_luma_samples <= 8 ? 0 : 3))
|
||||
if (sps_num_ver_virtual_boundaries > (unsigned)(pic_width_max_in_luma_samples <= 8 ? 0 : 3))
|
||||
return 1;
|
||||
for (size_t i = 0; i < sps_num_ver_virtual_boundaries; i++)
|
||||
{
|
||||
@ -783,7 +783,7 @@ int VvcSpsUnit::deserialize()
|
||||
return 1;
|
||||
}
|
||||
unsigned sps_num_hor_virtual_boundaries = extractUEGolombCode();
|
||||
if (sps_num_hor_virtual_boundaries > (pic_height_max_in_luma_samples <= 8 ? 0 : 3))
|
||||
if (sps_num_hor_virtual_boundaries > (unsigned)(pic_height_max_in_luma_samples <= 8 ? 0 : 3))
|
||||
return 1;
|
||||
for (size_t i = 0; i < sps_num_hor_virtual_boundaries; i++)
|
||||
{
|
||||
@ -821,7 +821,7 @@ int VvcSpsUnit::deserialize()
|
||||
}
|
||||
}
|
||||
|
||||
int VvcSpsUnit::ref_pic_list_struct(int rplsIdx)
|
||||
int VvcSpsUnit::ref_pic_list_struct(size_t rplsIdx)
|
||||
{
|
||||
unsigned num_ref_entries = extractUEGolombCode();
|
||||
bool ltrp_in_header_flag = 1;
|
||||
|
@ -137,7 +137,7 @@ struct VvcSpsUnit : public VvcUnitWithProfile
|
||||
bool full_range_flag;
|
||||
|
||||
private:
|
||||
int ref_pic_list_struct(int rplsIdx);
|
||||
int ref_pic_list_struct(size_t rplsIdx);
|
||||
unsigned sps_num_ref_pic_lists;
|
||||
bool weighted_pred_flag;
|
||||
bool weighted_bipred_flag;
|
||||
|
@ -112,14 +112,14 @@ CheckStreamRez VVCStreamReader::checkStream(uint8_t* buffer, int len)
|
||||
int VVCStreamReader::getTSDescriptor(uint8_t* dstBuff, bool blurayMode, bool hdmvDescriptors)
|
||||
{
|
||||
if (m_firstFrame)
|
||||
CheckStreamRez rez = checkStream(m_buffer, m_bufEnd - m_buffer);
|
||||
CheckStreamRez rez = checkStream(m_buffer, (int)(m_bufEnd - m_buffer));
|
||||
|
||||
if (hdmvDescriptors)
|
||||
{
|
||||
// 'HDMV' registration descriptor
|
||||
*dstBuff++ = 0x05;
|
||||
*dstBuff++ = 8;
|
||||
memcpy(dstBuff, "HDMV\xff\x24", 6);
|
||||
memcpy(dstBuff, "HDMV\xff\x33", 6);
|
||||
dstBuff += 6;
|
||||
|
||||
int video_format, frame_rate_index, aspect_ratio_index;
|
||||
@ -141,7 +141,7 @@ int VVCStreamReader::getTSDescriptor(uint8_t* dstBuff, bool blurayMode, bool hdm
|
||||
|
||||
if (nalType == V_SPS)
|
||||
{
|
||||
int toDecode = FFMIN(sizeof(tmpBuffer) - 8, nextNal - nal);
|
||||
int toDecode = (int)FFMIN(sizeof(tmpBuffer) - 8, nextNal - nal);
|
||||
int decodedLen = NALUnit::decodeNAL(nal, nal + toDecode, tmpBuffer, sizeof(tmpBuffer));
|
||||
break;
|
||||
}
|
||||
@ -186,7 +186,7 @@ int VVCStreamReader::getTSDescriptor(uint8_t* dstBuff, bool blurayMode, bool hdm
|
||||
|
||||
void VVCStreamReader::updateStreamFps(void* nalUnit, uint8_t* buff, uint8_t* nextNal, int)
|
||||
{
|
||||
int oldNalSize = nextNal - buff;
|
||||
int oldNalSize = (int)(nextNal - buff);
|
||||
m_vpsSizeDiff = 0;
|
||||
VvcVpsUnit* vps = (VvcVpsUnit*)nalUnit;
|
||||
vps->setFPS(m_fps);
|
||||
@ -282,7 +282,7 @@ void VVCStreamReader::storeBuffer(MemoryBlock& dst, const uint8_t* data, const u
|
||||
while (dataEnd > data && dataEnd[-1] == 0) dataEnd--;
|
||||
if (dataEnd > data)
|
||||
{
|
||||
dst.resize(dataEnd - data);
|
||||
dst.resize((int)(dataEnd - data));
|
||||
memcpy(dst.data(), data, dataEnd - data);
|
||||
}
|
||||
}
|
||||
@ -411,7 +411,7 @@ uint8_t* VVCStreamReader::writeBuffer(MemoryBlock& srcData, uint8_t* dstBuffer,
|
||||
{
|
||||
if (srcData.isEmpty())
|
||||
return dstBuffer;
|
||||
int bytesLeft = dstEnd - dstBuffer;
|
||||
int bytesLeft = (int)(dstEnd - dstBuffer);
|
||||
int requiredBytes = srcData.size() + 3 + (m_shortStartCodes ? 0 : 1);
|
||||
if (bytesLeft < requiredBytes)
|
||||
return dstBuffer;
|
||||
@ -452,5 +452,5 @@ int VVCStreamReader::writeAdditionData(uint8_t* dstBuffer, uint8_t* dstEnd, AVPa
|
||||
}
|
||||
|
||||
m_firstFileFrame = false;
|
||||
return curPos - dstBuffer;
|
||||
return (int)(curPos - dstBuffer);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user