Commit f4d95e09 authored by Clément Bœsch's avatar Clément Bœsch

lavc/vp9: rename {ref,unref,alloc}_frame to frame_{ref,unref,alloc}

For consistency with Libav.
parent 12c44d63
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#define VP9_SYNCCODE 0x498342 #define VP9_SYNCCODE 0x498342
static void vp9_unref_frame(AVCodecContext *avctx, VP9Frame *f) static void vp9_frame_unref(AVCodecContext *avctx, VP9Frame *f)
{ {
ff_thread_release_buffer(avctx, &f->tf); ff_thread_release_buffer(avctx, &f->tf);
av_buffer_unref(&f->extradata); av_buffer_unref(&f->extradata);
...@@ -45,7 +45,7 @@ static void vp9_unref_frame(AVCodecContext *avctx, VP9Frame *f) ...@@ -45,7 +45,7 @@ static void vp9_unref_frame(AVCodecContext *avctx, VP9Frame *f)
f->hwaccel_picture_private = NULL; f->hwaccel_picture_private = NULL;
} }
static int vp9_alloc_frame(AVCodecContext *avctx, VP9Frame *f) static int vp9_frame_alloc(AVCodecContext *avctx, VP9Frame *f)
{ {
VP9Context *s = avctx->priv_data; VP9Context *s = avctx->priv_data;
int ret, sz; int ret, sz;
...@@ -74,11 +74,11 @@ static int vp9_alloc_frame(AVCodecContext *avctx, VP9Frame *f) ...@@ -74,11 +74,11 @@ static int vp9_alloc_frame(AVCodecContext *avctx, VP9Frame *f)
return 0; return 0;
fail: fail:
vp9_unref_frame(avctx, f); vp9_frame_unref(avctx, f);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
static int vp9_ref_frame(AVCodecContext *avctx, VP9Frame *dst, VP9Frame *src) static int vp9_frame_ref(AVCodecContext *avctx, VP9Frame *dst, VP9Frame *src)
{ {
int res; int res;
...@@ -102,7 +102,7 @@ static int vp9_ref_frame(AVCodecContext *avctx, VP9Frame *dst, VP9Frame *src) ...@@ -102,7 +102,7 @@ static int vp9_ref_frame(AVCodecContext *avctx, VP9Frame *dst, VP9Frame *src)
return 0; return 0;
fail: fail:
vp9_unref_frame(avctx, dst); vp9_frame_unref(avctx, dst);
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
...@@ -1243,7 +1243,7 @@ static av_cold int vp9_decode_free(AVCodecContext *avctx) ...@@ -1243,7 +1243,7 @@ static av_cold int vp9_decode_free(AVCodecContext *avctx)
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
if (s->s.frames[i].tf.f->buf[0]) if (s->s.frames[i].tf.f->buf[0])
vp9_unref_frame(avctx, &s->s.frames[i]); vp9_frame_unref(avctx, &s->s.frames[i]);
av_frame_free(&s->s.frames[i].tf.f); av_frame_free(&s->s.frames[i].tf.f);
} }
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
...@@ -1306,19 +1306,19 @@ FF_ENABLE_DEPRECATION_WARNINGS ...@@ -1306,19 +1306,19 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (!retain_segmap_ref || s->s.h.keyframe || s->s.h.intraonly) { if (!retain_segmap_ref || s->s.h.keyframe || s->s.h.intraonly) {
if (s->s.frames[REF_FRAME_SEGMAP].tf.f->buf[0]) if (s->s.frames[REF_FRAME_SEGMAP].tf.f->buf[0])
vp9_unref_frame(avctx, &s->s.frames[REF_FRAME_SEGMAP]); vp9_frame_unref(avctx, &s->s.frames[REF_FRAME_SEGMAP]);
if (!s->s.h.keyframe && !s->s.h.intraonly && !s->s.h.errorres && s->s.frames[CUR_FRAME].tf.f->buf[0] && if (!s->s.h.keyframe && !s->s.h.intraonly && !s->s.h.errorres && s->s.frames[CUR_FRAME].tf.f->buf[0] &&
(res = vp9_ref_frame(avctx, &s->s.frames[REF_FRAME_SEGMAP], &s->s.frames[CUR_FRAME])) < 0) (res = vp9_frame_ref(avctx, &s->s.frames[REF_FRAME_SEGMAP], &s->s.frames[CUR_FRAME])) < 0)
return res; return res;
} }
if (s->s.frames[REF_FRAME_MVPAIR].tf.f->buf[0]) if (s->s.frames[REF_FRAME_MVPAIR].tf.f->buf[0])
vp9_unref_frame(avctx, &s->s.frames[REF_FRAME_MVPAIR]); vp9_frame_unref(avctx, &s->s.frames[REF_FRAME_MVPAIR]);
if (!s->s.h.intraonly && !s->s.h.keyframe && !s->s.h.errorres && s->s.frames[CUR_FRAME].tf.f->buf[0] && if (!s->s.h.intraonly && !s->s.h.keyframe && !s->s.h.errorres && s->s.frames[CUR_FRAME].tf.f->buf[0] &&
(res = vp9_ref_frame(avctx, &s->s.frames[REF_FRAME_MVPAIR], &s->s.frames[CUR_FRAME])) < 0) (res = vp9_frame_ref(avctx, &s->s.frames[REF_FRAME_MVPAIR], &s->s.frames[CUR_FRAME])) < 0)
return res; return res;
if (s->s.frames[CUR_FRAME].tf.f->buf[0]) if (s->s.frames[CUR_FRAME].tf.f->buf[0])
vp9_unref_frame(avctx, &s->s.frames[CUR_FRAME]); vp9_frame_unref(avctx, &s->s.frames[CUR_FRAME]);
if ((res = vp9_alloc_frame(avctx, &s->s.frames[CUR_FRAME])) < 0) if ((res = vp9_frame_alloc(avctx, &s->s.frames[CUR_FRAME])) < 0)
return res; return res;
f = s->s.frames[CUR_FRAME].tf.f; f = s->s.frames[CUR_FRAME].tf.f;
f->key_frame = s->s.h.keyframe; f->key_frame = s->s.h.keyframe;
...@@ -1329,7 +1329,7 @@ FF_ENABLE_DEPRECATION_WARNINGS ...@@ -1329,7 +1329,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (s->s.frames[REF_FRAME_SEGMAP].tf.f->buf[0] && if (s->s.frames[REF_FRAME_SEGMAP].tf.f->buf[0] &&
(s->s.frames[REF_FRAME_MVPAIR].tf.f->width != s->s.frames[CUR_FRAME].tf.f->width || (s->s.frames[REF_FRAME_MVPAIR].tf.f->width != s->s.frames[CUR_FRAME].tf.f->width ||
s->s.frames[REF_FRAME_MVPAIR].tf.f->height != s->s.frames[CUR_FRAME].tf.f->height)) { s->s.frames[REF_FRAME_MVPAIR].tf.f->height != s->s.frames[CUR_FRAME].tf.f->height)) {
vp9_unref_frame(avctx, &s->s.frames[REF_FRAME_SEGMAP]); vp9_frame_unref(avctx, &s->s.frames[REF_FRAME_SEGMAP]);
} }
// ref frame setup // ref frame setup
...@@ -1554,7 +1554,7 @@ static void vp9_decode_flush(AVCodecContext *avctx) ...@@ -1554,7 +1554,7 @@ static void vp9_decode_flush(AVCodecContext *avctx)
int i; int i;
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
vp9_unref_frame(avctx, &s->s.frames[i]); vp9_frame_unref(avctx, &s->s.frames[i]);
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
ff_thread_release_buffer(avctx, &s->s.refs[i]); ff_thread_release_buffer(avctx, &s->s.refs[i]);
} }
...@@ -1609,9 +1609,9 @@ static int vp9_decode_update_thread_context(AVCodecContext *dst, const AVCodecCo ...@@ -1609,9 +1609,9 @@ static int vp9_decode_update_thread_context(AVCodecContext *dst, const AVCodecCo
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
if (s->s.frames[i].tf.f->buf[0]) if (s->s.frames[i].tf.f->buf[0])
vp9_unref_frame(dst, &s->s.frames[i]); vp9_frame_unref(dst, &s->s.frames[i]);
if (ssrc->s.frames[i].tf.f->buf[0]) { if (ssrc->s.frames[i].tf.f->buf[0]) {
if ((res = vp9_ref_frame(dst, &s->s.frames[i], &ssrc->s.frames[i])) < 0) if ((res = vp9_frame_ref(dst, &s->s.frames[i], &ssrc->s.frames[i])) < 0)
return res; return res;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment