aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-01-17 12:25:31 +0100
committerAnton Khirnov <anton@khirnov.net>2013-01-18 07:56:05 +0100
commit940b8b5861241df7aff8977774e1de6e67de5b83 (patch)
treec331d9598e7f1ef430e72888517e04ff920fb398 /libavcodec
parentb90632d5964d3998bab7323468a6b43ab6a24b34 (diff)
downloadffmpeg-940b8b5861241df7aff8977774e1de6e67de5b83.tar.gz
h264: avoid pointless copying of ref lists
ref_list is constructed from other fields per slice when needed, so do not copy it for both frame and slice threading. default_ref_list is constructed per frame and still needs to be copied to per-slice contexts for slice threading, but a copy is not needed for frame threading.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264.c3
-rw-r--r--libavcodec/h264.h2
2 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 2a711bdfff..5b7b18c7be 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1253,7 +1253,7 @@ static int decode_update_thread_context(AVCodecContext *dst,
// reference lists
copy_fields(h, h1, ref_count, list_count);
- copy_fields(h, h1, ref_list, intra_gb);
+ copy_fields(h, h1, ref2frm, intra_gb);
copy_fields(h, h1, short_ref, cabac_init_idc);
copy_picture_range(h->short_ref, h1->short_ref, 32, s, s1);
@@ -2369,7 +2369,6 @@ static int clone_slice(H264Context *dst, H264Context *src)
memcpy(dst->short_ref, src->short_ref, sizeof(dst->short_ref));
memcpy(dst->long_ref, src->long_ref, sizeof(dst->long_ref));
memcpy(dst->default_ref_list, src->default_ref_list, sizeof(dst->default_ref_list));
- memcpy(dst->ref_list, src->ref_list, sizeof(dst->ref_list));
memcpy(dst->dequant4_coeff, src->dequant4_coeff, sizeof(src->dequant4_coeff));
memcpy(dst->dequant8_coeff, src->dequant8_coeff, sizeof(src->dequant8_coeff));
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 898ebf7b0a..cdfe1b6308 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -481,9 +481,9 @@ typedef struct H264Context {
int redundant_pic_count;
+ Picture default_ref_list[2][32]; ///< base reference list for all slices of a coded picture
Picture *short_ref[32];
Picture *long_ref[32];
- Picture default_ref_list[2][32]; ///< base reference list for all slices of a coded picture
Picture *delayed_pic[MAX_DELAYED_PIC_COUNT + 2]; // FIXME size?
int last_pocs[MAX_DELAYED_PIC_COUNT];
Picture *next_output_pic;