1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:07:34 +00:00

LibVideo/VP9: Move the m_use_prev_frame_mvs field to FrameContext

This commit is contained in:
Zaggy1024 2022-11-27 01:02:08 -06:00 committed by Andreas Kling
parent 6ffb0844a1
commit b5cce5a448
3 changed files with 5 additions and 4 deletions

View file

@ -53,6 +53,8 @@ public:
} }
u8 existing_frame_index() const { return m_existing_frame_index; } u8 existing_frame_index() const { return m_existing_frame_index; }
bool use_previous_frame_motion_vectors { false };
ColorConfig color_config {}; ColorConfig color_config {};
u8 reference_frames_to_update_flags { 0 }; u8 reference_frames_to_update_flags { 0 };

View file

@ -391,7 +391,7 @@ DecoderErrorOr<void> Parser::compute_image_size(FrameContext& frame_context)
// d. error_resilient_mode is equal to 0. // d. error_resilient_mode is equal to 0.
// e. FrameIsIntra is equal to 0. // e. FrameIsIntra is equal to 0.
// Otherwise, UsePrevFrameMvs is set equal to 0. // Otherwise, UsePrevFrameMvs is set equal to 0.
m_use_prev_frame_mvs = !first_invoke && same_size && m_previous_show_frame && !frame_context.error_resilient_mode && frame_context.is_inter_predicted(); frame_context.use_previous_frame_motion_vectors = !first_invoke && same_size && m_previous_show_frame && !frame_context.error_resilient_mode && frame_context.is_inter_predicted();
return {}; return {};
} }
@ -1634,7 +1634,7 @@ MotionVectorPair Parser::find_reference_motion_vectors(BlockContext const& block
add_motion_vector_if_reference_frame_type_is_same(block_context, candidate, reference_frame, list, false); add_motion_vector_if_reference_frame_type_is_same(block_context, candidate, reference_frame, list, false);
} }
} }
if (m_use_prev_frame_mvs) if (block_context.frame_context.use_previous_frame_motion_vectors)
add_motion_vector_if_reference_frame_type_is_same(block_context, base_coordinates, reference_frame, list, true); add_motion_vector_if_reference_frame_type_is_same(block_context, base_coordinates, reference_frame, list, true);
if (different_ref_found) { if (different_ref_found) {
@ -1644,7 +1644,7 @@ MotionVectorPair Parser::find_reference_motion_vectors(BlockContext const& block
add_motion_vector_if_reference_frame_type_is_different(block_context, candidate, reference_frame, list, false); add_motion_vector_if_reference_frame_type_is_different(block_context, candidate, reference_frame, list, false);
} }
} }
if (m_use_prev_frame_mvs) if (block_context.frame_context.use_previous_frame_motion_vectors)
add_motion_vector_if_reference_frame_type_is_different(block_context, base_coordinates, reference_frame, list, true); add_motion_vector_if_reference_frame_type_is_different(block_context, base_coordinates, reference_frame, list, true);
m_mode_context[reference_frame] = counter_to_context[context_counter]; m_mode_context[reference_frame] = counter_to_context[context_counter];

View file

@ -162,7 +162,6 @@ private:
Vector<u16> m_frame_store[NUM_REF_FRAMES][3]; Vector<u16> m_frame_store[NUM_REF_FRAMES][3];
bool m_use_prev_frame_mvs;
Vector2D<FrameBlockContext> m_reusable_frame_block_contexts; Vector2D<FrameBlockContext> m_reusable_frame_block_contexts;
Vector2D<PersistentBlockContext> m_previous_block_contexts; Vector2D<PersistentBlockContext> m_previous_block_contexts;
// Indexed by ReferenceFrame enum. // Indexed by ReferenceFrame enum.