Skip to content

Commit

Permalink
警告対策。
Browse files Browse the repository at this point in the history
  • Loading branch information
rigaya committed Aug 13, 2024
1 parent 6fadc9c commit e4230ac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions NVEnc/NVEnc_readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ NVIDIA グラフィックドライバ 551.23
今後の更新で設定ファイルの互換性がなくなるかもしれません。

【メモ】
2024.08.13 (7.64)
- --dhdr10-info copyと--dolby-vision-rpu copyを併用すると、--dhdr10-info copyが効かなくなっていた問題を修正。
- alphaチャンネルのモードを指定するオプションを追加。

2024.08.12 (7.63)
- HEVC+alphaエンコード時に、入力が高ビット深度だと透明度の位置がずれてしまう問題を修正。
- alphaチャンネルに割り当てるビットレートの割合を指定するオプションを追加。(--alpha-bitrate-ratio)
Expand Down
8 changes: 4 additions & 4 deletions NVEncCore/rgy_input_avcodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ void RGYInputAvcodec::hevcMp42Annexb(AVPacket *pkt) {
m_hevcMp42AnnexbBuffer.insert(m_hevcMp42AnnexbBuffer.end(), SC, SC + 4);
m_hevcMp42AnnexbBuffer.insert(m_hevcMp42AnnexbBuffer.end(), ptr, ptr + size); ptr += size;
}
if (pkt->buf->size < (int)m_hevcMp42AnnexbBuffer.size() + AV_INPUT_BUFFER_PADDING_SIZE) {
if (pkt->buf->size < m_hevcMp42AnnexbBuffer.size() + AV_INPUT_BUFFER_PADDING_SIZE) {
av_grow_packet(pkt, (int)m_hevcMp42AnnexbBuffer.size() + AV_INPUT_BUFFER_PADDING_SIZE);
}
memcpy(pkt->data, m_hevcMp42AnnexbBuffer.data(), m_hevcMp42AnnexbBuffer.size());
Expand Down Expand Up @@ -1279,7 +1279,7 @@ RGY_ERR RGYInputAvcodec::parseHDR10plusDOVIRpuHEVC(AVPacket *pkt, const bool hdr
continue;
}
const uint8_t *ptr = nal_unit.ptr;
int header_size = 0;
size_t header_size = 0;
//nal header
if (ptr[0] == 0x00
&& ptr[1] == 0x00
Expand Down Expand Up @@ -1344,7 +1344,7 @@ RGY_ERR RGYInputAvcodec::parseHDR10plusDOVIRpuAV1(AVPacket *pkt, const bool hdr1
const uint8_t *const start_metadata = start_obu + 1 /*metadata type*/;
int metadata_size = av1_unit->unit_data.size() - av1_unit->obu_offset - 1/*metadata type*/;
if (hdr10plus
&& metadata_size > sizeof(av1_itut_t35_header_hdr10plus)
&& metadata_size > (int)sizeof(av1_itut_t35_header_hdr10plus)
&& memcmp(start_metadata, av1_itut_t35_header_hdr10plus, sizeof(av1_itut_t35_header_hdr10plus)) == 0) {
if (fin_pos[-1] == 0x80) {
metadata_size--;
Expand All @@ -1355,7 +1355,7 @@ RGY_ERR RGYInputAvcodec::parseHDR10plusDOVIRpuAV1(AVPacket *pkt, const bool hdr1
}
}
if (doviRpu
&& metadata_size > sizeof(av1_itut_t35_header_dovirpu)
&& metadata_size > (int)sizeof(av1_itut_t35_header_dovirpu)
&& memcmp(start_metadata, av1_itut_t35_header_dovirpu, sizeof(av1_itut_t35_header_dovirpu)) == 0) {
if (fin_pos[-1] == 0x80) {
metadata_size--;
Expand Down
2 changes: 1 addition & 1 deletion NVEncCore/rgy_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ RGY_ERR RGYOutput::InsertMetadata(RGYBitstream *bitstream, std::vector<std::uniq
for (size_t i = 0; i < av1_units.size(); i++) {
bitstream->append(av1_units[i]->unit_data.data(), av1_units[i]->unit_data.size());
if (av1_units[i]->type == OBU_TEMPORAL_DELIMITER || av1_units[i]->type == OBU_SEQUENCE_HEADER) {
if (i + 1 < (int)av1_units.size()
if (i + 1 < av1_units.size()
&& (av1_units[i + 1]->type != OBU_TEMPORAL_DELIMITER && av1_units[i + 1]->type != OBU_SEQUENCE_HEADER)) {
for (auto& metadata : metadataList) {
if (!metadata->written && !metadata->appendix) {
Expand Down

0 comments on commit e4230ac

Please sign in to comment.