Message ID | 20181220153929.8396-1-jamrial@gmail.com |
---|---|
State | Accepted |
Commit | 064f9505f49816650516c7afe93e43d8f547891a |
Headers | show |
On 20/12/2018 15:39, James Almer wrote: > delta_frame_id_minus1 is not a single value in the bitstream, and can > store values up to 17 bits wide. > > Fixes parsing files with frame ids. > > Signed-off-by: James Almer <jamrial@gmail.com> > --- > See https://code.videolan.org/videolan/dav1d/uploads/a23d47dda3011a8e39ab1ac7c508b220/input.ivf > > libavcodec/cbs_av1.h | 2 +- > libavcodec/cbs_av1_syntax_template.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h > index 84622ed189..71ceff9427 100644 > --- a/libavcodec/cbs_av1.h > +++ b/libavcodec/cbs_av1.h > @@ -170,7 +170,7 @@ typedef struct AV1RawFrameHeader { > uint8_t last_frame_idx; > uint8_t golden_frame_idx; > int8_t ref_frame_idx[AV1_REFS_PER_FRAME]; > - uint8_t delta_frame_id_minus1; > + uint32_t delta_frame_id_minus1[AV1_REFS_PER_FRAME]; > > uint8_t allow_high_precision_mv; > uint8_t is_filter_switchable; > diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c > index 0da79b615d..48f4fab514 100644 > --- a/libavcodec/cbs_av1_syntax_template.c > +++ b/libavcodec/cbs_av1_syntax_template.c > @@ -1323,8 +1323,8 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw, > if (!current->frame_refs_short_signaling) > fbs(3, ref_frame_idx[i], 1, i); > if (seq->frame_id_numbers_present_flag) { > - fb(seq->delta_frame_id_length_minus_2 + 2, > - delta_frame_id_minus1); > + fbs(seq->delta_frame_id_length_minus_2 + 2, > + delta_frame_id_minus1[i], 1, i); > } > } > > Yep, LGTM. (I hate the mutable single-syntax-element variables in that spec.) Thanks, - Mark
On 12/20/2018 5:45 PM, Mark Thompson wrote: > On 20/12/2018 15:39, James Almer wrote: >> delta_frame_id_minus1 is not a single value in the bitstream, and can >> store values up to 17 bits wide. >> >> Fixes parsing files with frame ids. >> >> Signed-off-by: James Almer <jamrial@gmail.com> >> --- >> See https://code.videolan.org/videolan/dav1d/uploads/a23d47dda3011a8e39ab1ac7c508b220/input.ivf >> >> libavcodec/cbs_av1.h | 2 +- >> libavcodec/cbs_av1_syntax_template.c | 4 ++-- >> 2 files changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h >> index 84622ed189..71ceff9427 100644 >> --- a/libavcodec/cbs_av1.h >> +++ b/libavcodec/cbs_av1.h >> @@ -170,7 +170,7 @@ typedef struct AV1RawFrameHeader { >> uint8_t last_frame_idx; >> uint8_t golden_frame_idx; >> int8_t ref_frame_idx[AV1_REFS_PER_FRAME]; >> - uint8_t delta_frame_id_minus1; >> + uint32_t delta_frame_id_minus1[AV1_REFS_PER_FRAME]; >> >> uint8_t allow_high_precision_mv; >> uint8_t is_filter_switchable; >> diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c >> index 0da79b615d..48f4fab514 100644 >> --- a/libavcodec/cbs_av1_syntax_template.c >> +++ b/libavcodec/cbs_av1_syntax_template.c >> @@ -1323,8 +1323,8 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw, >> if (!current->frame_refs_short_signaling) >> fbs(3, ref_frame_idx[i], 1, i); >> if (seq->frame_id_numbers_present_flag) { >> - fb(seq->delta_frame_id_length_minus_2 + 2, >> - delta_frame_id_minus1); >> + fbs(seq->delta_frame_id_length_minus_2 + 2, >> + delta_frame_id_minus1[i], 1, i); >> } >> } >> >> > > Yep, LGTM. (I hate the mutable single-syntax-element variables in that spec.) > > Thanks, > > - Mark Pushed, will backport later. Thanks!
diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h index 84622ed189..71ceff9427 100644 --- a/libavcodec/cbs_av1.h +++ b/libavcodec/cbs_av1.h @@ -170,7 +170,7 @@ typedef struct AV1RawFrameHeader { uint8_t last_frame_idx; uint8_t golden_frame_idx; int8_t ref_frame_idx[AV1_REFS_PER_FRAME]; - uint8_t delta_frame_id_minus1; + uint32_t delta_frame_id_minus1[AV1_REFS_PER_FRAME]; uint8_t allow_high_precision_mv; uint8_t is_filter_switchable; diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c index 0da79b615d..48f4fab514 100644 --- a/libavcodec/cbs_av1_syntax_template.c +++ b/libavcodec/cbs_av1_syntax_template.c @@ -1323,8 +1323,8 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw, if (!current->frame_refs_short_signaling) fbs(3, ref_frame_idx[i], 1, i); if (seq->frame_id_numbers_present_flag) { - fb(seq->delta_frame_id_length_minus_2 + 2, - delta_frame_id_minus1); + fbs(seq->delta_frame_id_length_minus_2 + 2, + delta_frame_id_minus1[i], 1, i); } }
delta_frame_id_minus1 is not a single value in the bitstream, and can store values up to 17 bits wide. Fixes parsing files with frame ids. Signed-off-by: James Almer <jamrial@gmail.com> --- See https://code.videolan.org/videolan/dav1d/uploads/a23d47dda3011a8e39ab1ac7c508b220/input.ivf libavcodec/cbs_av1.h | 2 +- libavcodec/cbs_av1_syntax_template.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)