[FFmpeg-cvslog] vp9: permanently delete segmentation refmap on any size change.
Ronald S. Bultje
git at videolan.org
Thu Sep 10 13:52:22 CEST 2015
ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Wed Sep 9 12:42:24 2015 -0400| [4bb9dbe4d7952d82bddb23c45889ab1550897397] | committer: Ronald S. Bultje
vp9: permanently delete segmentation refmap on any size change.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4bb9dbe4d7952d82bddb23c45889ab1550897397
---
libavcodec/vp9.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 25e7419..98fd8a3 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -153,7 +153,6 @@ typedef struct VP9Context {
uint8_t temporal;
uint8_t absolute_vals;
uint8_t update_map;
- uint8_t ignore_refmap;
struct {
uint8_t q_enabled;
uint8_t lf_enabled;
@@ -743,7 +742,6 @@ static int decode_frame_header(AVCodecContext *ctx,
ctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
/* segmentation header info */
- s->segmentation.ignore_refmap = 0;
if ((s->segmentation.enabled = get_bits1(&s->gb))) {
if ((s->segmentation.update_map = get_bits1(&s->gb))) {
for (i = 0; i < 7; i++)
@@ -755,15 +753,6 @@ static int decode_frame_header(AVCodecContext *ctx,
get_bits(&s->gb, 8) : 255;
}
}
- if ((!s->segmentation.update_map || s->segmentation.temporal) &&
- (w != s->frames[CUR_FRAME].tf.f->width ||
- h != s->frames[CUR_FRAME].tf.f->height)) {
- av_log(ctx, AV_LOG_WARNING,
- "Reference segmap (temp=%d,update=%d) enabled on size-change!\n",
- s->segmentation.temporal, s->segmentation.update_map);
- s->segmentation.ignore_refmap = 1;
- //return AVERROR_INVALIDDATA;
- }
if (get_bits1(&s->gb)) {
s->segmentation.absolute_vals = get_bits1(&s->gb);
@@ -1490,7 +1479,7 @@ static void decode_mode(AVCodecContext *ctx)
vp56_rac_get_prob_branchy(&s->c,
s->prob.segpred[s->above_segpred_ctx[col] +
s->left_segpred_ctx[row7]]))) {
- if (!s->errorres && !s->segmentation.ignore_refmap) {
+ if (!s->errorres && s->frames[REF_FRAME_SEGMAP].segmentation_map) {
int pred = 8, x;
uint8_t *refsegmap = s->frames[REF_FRAME_SEGMAP].segmentation_map;
@@ -4064,6 +4053,12 @@ static int vp9_decode_frame(AVCodecContext *ctx, void *frame,
ls_y = f->linesize[0];
ls_uv =f->linesize[1];
+ if (s->frames[REF_FRAME_SEGMAP].tf.f->data[0] &&
+ (s->frames[REF_FRAME_MVPAIR].tf.f->width != s->frames[CUR_FRAME].tf.f->width ||
+ s->frames[REF_FRAME_MVPAIR].tf.f->height != s->frames[CUR_FRAME].tf.f->height)) {
+ vp9_unref_frame(ctx, &s->frames[REF_FRAME_SEGMAP]);
+ }
+
// ref frame setup
for (i = 0; i < 8; i++) {
if (s->next_refs[i].f->data[0])
More information about the ffmpeg-cvslog
mailing list