ffmpeg | branch: master | Andreas Rheinhardt <[email protected]> | Fri Mar 25 18:39:16 2022 +0100| [6e5acb6c88e00335a60b235a45d49e03424046ac] | committer: Andreas Rheinhardt
avcodec/error_resilience: Only keep what is needed from MECmpContext ERContext currently has an embedded MECmpContext, despite only needing exactly one function from it. This is wasteful because MECmpContext is pretty large (135 pointers, 1080 B for eight byte pointers). So keep only what is needed. Signed-off-by: Andreas Rheinhardt <[email protected]> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6e5acb6c88e00335a60b235a45d49e03424046ac --- libavcodec/error_resilience.c | 14 ++++++++------ libavcodec/error_resilience.h | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c index e9764f8d96..f957c68d2c 100644 --- a/libavcodec/error_resilience.c +++ b/libavcodec/error_resilience.c @@ -766,12 +766,12 @@ static int is_intra_more_likely(ERContext *s) } else { ff_thread_await_progress(s->last_pic.tf, mb_y, 0); } - is_intra_likely += s->mecc.sad[0](NULL, last_mb_ptr, mb_ptr, - linesize[0], 16); + is_intra_likely += s->sad(NULL, last_mb_ptr, mb_ptr, + linesize[0], 16); // FIXME need await_progress() here - is_intra_likely -= s->mecc.sad[0](NULL, last_mb_ptr, - last_mb_ptr + linesize[0] * 16, - linesize[0], 16); + is_intra_likely -= s->sad(NULL, last_mb_ptr, + last_mb_ptr + linesize[0] * 16, + linesize[0], 16); } else { if (IS_INTRA(s->cur_pic.mb_type[mb_xy])) is_intra_likely++; @@ -790,7 +790,9 @@ void ff_er_frame_start(ERContext *s) return; if (!s->mecc_inited) { - ff_me_cmp_init(&s->mecc, s->avctx); + MECmpContext mecc; + ff_me_cmp_init(&mecc, s->avctx); + s->sad = mecc.sad[0]; s->mecc_inited = 1; } diff --git a/libavcodec/error_resilience.h b/libavcodec/error_resilience.h index 2187586618..53e5cf2621 100644 --- a/libavcodec/error_resilience.h +++ b/libavcodec/error_resilience.h @@ -52,7 +52,8 @@ typedef struct ERPicture { typedef struct ERContext { AVCodecContext *avctx; - MECmpContext mecc; + + me_cmp_func sad; int mecc_inited; int *mb_index2xy; _______________________________________________ ffmpeg-cvslog mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
