|
|
@ -30,7 +30,7 @@ |
|
|
|
#include "refstruct.h" |
|
|
|
#include "refstruct.h" |
|
|
|
#include "threadframe.h" |
|
|
|
#include "threadframe.h" |
|
|
|
|
|
|
|
|
|
|
|
static void av_noinline free_picture_tables(Picture *pic) |
|
|
|
static void av_noinline free_picture_tables(MPVPicture *pic) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ff_refstruct_unref(&pic->mbskip_table); |
|
|
|
ff_refstruct_unref(&pic->mbskip_table); |
|
|
|
ff_refstruct_unref(&pic->qscale_table_base); |
|
|
|
ff_refstruct_unref(&pic->qscale_table_base); |
|
|
@ -116,7 +116,7 @@ int ff_mpv_pic_check_linesize(void *logctx, const AVFrame *f, |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static int alloc_picture_tables(BufferPoolContext *pools, Picture *pic, |
|
|
|
static int alloc_picture_tables(BufferPoolContext *pools, MPVPicture *pic, |
|
|
|
int mb_height) |
|
|
|
int mb_height) |
|
|
|
{ |
|
|
|
{ |
|
|
|
#define GET_BUFFER(name, buf_suffix, idx_suffix) do { \ |
|
|
|
#define GET_BUFFER(name, buf_suffix, idx_suffix) do { \ |
|
|
@ -143,7 +143,7 @@ static int alloc_picture_tables(BufferPoolContext *pools, Picture *pic, |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int ff_mpv_alloc_pic_accessories(AVCodecContext *avctx, Picture *pic, |
|
|
|
int ff_mpv_alloc_pic_accessories(AVCodecContext *avctx, MPVPicture *pic, |
|
|
|
MotionEstContext *me, ScratchpadContext *sc, |
|
|
|
MotionEstContext *me, ScratchpadContext *sc, |
|
|
|
BufferPoolContext *pools, int mb_height) |
|
|
|
BufferPoolContext *pools, int mb_height) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -181,7 +181,7 @@ fail: |
|
|
|
* Deallocate a picture; frees the picture tables in case they |
|
|
|
* Deallocate a picture; frees the picture tables in case they |
|
|
|
* need to be reallocated anyway. |
|
|
|
* need to be reallocated anyway. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void ff_mpeg_unref_picture(Picture *pic) |
|
|
|
void ff_mpeg_unref_picture(MPVPicture *pic) |
|
|
|
{ |
|
|
|
{ |
|
|
|
pic->tf.f = pic->f; |
|
|
|
pic->tf.f = pic->f; |
|
|
|
ff_thread_release_ext_buffer(&pic->tf); |
|
|
|
ff_thread_release_ext_buffer(&pic->tf); |
|
|
@ -203,7 +203,7 @@ void ff_mpeg_unref_picture(Picture *pic) |
|
|
|
pic->coded_picture_number = 0; |
|
|
|
pic->coded_picture_number = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void update_picture_tables(Picture *dst, const Picture *src) |
|
|
|
static void update_picture_tables(MPVPicture *dst, const MPVPicture *src) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ff_refstruct_replace(&dst->mbskip_table, src->mbskip_table); |
|
|
|
ff_refstruct_replace(&dst->mbskip_table, src->mbskip_table); |
|
|
|
ff_refstruct_replace(&dst->qscale_table_base, src->qscale_table_base); |
|
|
|
ff_refstruct_replace(&dst->qscale_table_base, src->qscale_table_base); |
|
|
@ -223,7 +223,7 @@ static void update_picture_tables(Picture *dst, const Picture *src) |
|
|
|
dst->mb_stride = src->mb_stride; |
|
|
|
dst->mb_stride = src->mb_stride; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int ff_mpeg_ref_picture(Picture *dst, Picture *src) |
|
|
|
int ff_mpeg_ref_picture(MPVPicture *dst, MPVPicture *src) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int ret; |
|
|
|
int ret; |
|
|
|
|
|
|
|
|
|
|
@ -260,7 +260,7 @@ fail: |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int ff_find_unused_picture(AVCodecContext *avctx, Picture *picture, int shared) |
|
|
|
int ff_find_unused_picture(AVCodecContext *avctx, MPVPicture *picture, int shared) |
|
|
|
{ |
|
|
|
{ |
|
|
|
for (int i = 0; i < MAX_PICTURE_COUNT; i++) |
|
|
|
for (int i = 0; i < MAX_PICTURE_COUNT; i++) |
|
|
|
if (!picture[i].f->buf[0]) |
|
|
|
if (!picture[i].f->buf[0]) |
|
|
@ -283,7 +283,7 @@ int ff_find_unused_picture(AVCodecContext *avctx, Picture *picture, int shared) |
|
|
|
return -1; |
|
|
|
return -1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void av_cold ff_mpv_picture_free(Picture *pic) |
|
|
|
void av_cold ff_mpv_picture_free(MPVPicture *pic) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ff_mpeg_unref_picture(pic); |
|
|
|
ff_mpeg_unref_picture(pic); |
|
|
|
av_frame_free(&pic->f); |
|
|
|
av_frame_free(&pic->f); |
|
|
|