vp9: Ensure the first frame is complete
Silences a runtime error due to the first frame missing the frame data, and being set to hidden despite being a key-frame.
This commit is contained in:
parent
63325cafbe
commit
fa22695705
@ -397,14 +397,14 @@ Vp9FrameContainer VP9::GetCurrentFrame(const NvdecCommon::NvdecRegisters& state)
|
|||||||
next_frame = std::move(temp);
|
next_frame = std::move(temp);
|
||||||
} else {
|
} else {
|
||||||
next_frame.info = current_frame.info;
|
next_frame.info = current_frame.info;
|
||||||
next_frame.bit_stream = std::move(current_frame.bit_stream);
|
next_frame.bit_stream = current_frame.bit_stream;
|
||||||
}
|
}
|
||||||
return current_frame;
|
return current_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<u8> VP9::ComposeCompressedHeader() {
|
std::vector<u8> VP9::ComposeCompressedHeader() {
|
||||||
VpxRangeEncoder writer{};
|
VpxRangeEncoder writer{};
|
||||||
const bool update_probs = current_frame_info.show_frame && !current_frame_info.is_key_frame;
|
const bool update_probs = !current_frame_info.is_key_frame && current_frame_info.show_frame;
|
||||||
if (!current_frame_info.lossless) {
|
if (!current_frame_info.lossless) {
|
||||||
if (static_cast<u32>(current_frame_info.transform_mode) >= 3) {
|
if (static_cast<u32>(current_frame_info.transform_mode) >= 3) {
|
||||||
writer.Write(3, 2);
|
writer.Write(3, 2);
|
||||||
|
@ -176,7 +176,7 @@ struct PictureInfo {
|
|||||||
.frame_size_changed = (vp9_flags & FrameFlags::FrameSizeChanged) != 0,
|
.frame_size_changed = (vp9_flags & FrameFlags::FrameSizeChanged) != 0,
|
||||||
.error_resilient_mode = (vp9_flags & FrameFlags::ErrorResilientMode) != 0,
|
.error_resilient_mode = (vp9_flags & FrameFlags::ErrorResilientMode) != 0,
|
||||||
.last_frame_shown = (vp9_flags & FrameFlags::LastShowFrame) != 0,
|
.last_frame_shown = (vp9_flags & FrameFlags::LastShowFrame) != 0,
|
||||||
.show_frame = false,
|
.show_frame = true,
|
||||||
.ref_frame_sign_bias = ref_frame_sign_bias,
|
.ref_frame_sign_bias = ref_frame_sign_bias,
|
||||||
.base_q_index = base_q_index,
|
.base_q_index = base_q_index,
|
||||||
.y_dc_delta_q = y_dc_delta_q,
|
.y_dc_delta_q = y_dc_delta_q,
|
||||||
|
Loading…
Reference in New Issue
Block a user