codecparsers: av1: all ref idx should be gint8.

All the ref index need to compare with 0 in reference index decision
algorithm. We also need to init them to -1.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1464>
This commit is contained in:
He Junyan 2020-07-24 12:49:10 +08:00 committed by Víctor Manuel Jáquez Leal
parent 483768cfa7
commit 7e33863b10
2 changed files with 9 additions and 4 deletions

View file

@ -4355,9 +4355,14 @@ gst_av1_parse_frame_header (GstAV1Parser * parser, GstAV1OBU * obu,
GstBitReader * bit_reader, GstAV1FrameHeaderOBU * frame_header) GstBitReader * bit_reader, GstAV1FrameHeaderOBU * frame_header)
{ {
GstAV1ParserResult ret; GstAV1ParserResult ret;
guint i;
memset (frame_header, 0, sizeof (*frame_header)); memset (frame_header, 0, sizeof (*frame_header));
frame_header->frame_is_intra = 1; frame_header->frame_is_intra = 1;
frame_header->last_frame_idx = -1;
frame_header->gold_frame_idx = -1;
for (i = 0; i < GST_AV1_REFS_PER_FRAME; i++)
frame_header->ref_frame_idx[i] = -1;
ret = gst_av1_parse_uncompressed_frame_header (parser, obu, bit_reader, ret = gst_av1_parse_uncompressed_frame_header (parser, obu, bit_reader,
frame_header); frame_header);

View file

@ -1516,7 +1516,7 @@ struct _GstAV1FilmGrainParams {
*/ */
struct _GstAV1FrameHeaderOBU { struct _GstAV1FrameHeaderOBU {
gboolean show_existing_frame; gboolean show_existing_frame;
guint8 frame_to_show_map_idx; gint8 frame_to_show_map_idx;
guint32 frame_presentation_time; guint32 frame_presentation_time;
guint32 tu_presentation_delay; guint32 tu_presentation_delay;
guint32 display_frame_id; guint32 display_frame_id;
@ -1538,8 +1538,8 @@ struct _GstAV1FrameHeaderOBU {
gboolean allow_intrabc; gboolean allow_intrabc;
gboolean frame_refs_short_signaling; gboolean frame_refs_short_signaling;
guint8 last_frame_idx; guint8 last_frame_idx;
guint8 gold_frame_idx; gint8 gold_frame_idx;
guint8 ref_frame_idx[GST_AV1_REFS_PER_FRAME]; gint8 ref_frame_idx[GST_AV1_REFS_PER_FRAME];
gboolean allow_high_precision_mv; gboolean allow_high_precision_mv;
gboolean is_motion_mode_switchable; gboolean is_motion_mode_switchable;
gboolean use_ref_frame_mvs; gboolean use_ref_frame_mvs;
@ -1636,7 +1636,7 @@ struct _GstAV1TileListOBU {
guint8 output_frame_height_in_tiles_minus_1; guint8 output_frame_height_in_tiles_minus_1;
guint16 tile_count_minus_1; guint16 tile_count_minus_1;
struct { struct {
guint8 anchor_frame_idx; gint8 anchor_frame_idx;
guint8 anchor_tile_row; guint8 anchor_tile_row;
guint8 anchor_tile_col; guint8 anchor_tile_col;
guint16 tile_data_size_minus_1; guint16 tile_data_size_minus_1;