aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vaapi_encode.h
diff options
context:
space:
mode:
authorFei Wang <fei.w.wang@intel.com>2023-09-11 15:52:30 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2023-09-22 13:15:00 +0800
commit254c5a8134a177244fc0995c3b2998079a755848 (patch)
tree29782c8d039fd9c86ec961bc6f2445d5fc885713 /libavcodec/vaapi_encode.h
parent11b81838ae64095fcc130f4747a6adc8676a4998 (diff)
downloadffmpeg-254c5a8134a177244fc0995c3b2998079a755848.tar.gz
lavc/vaapi_encode: Separate reference frame into previous/future list
To support more reference frames from different directions. Signed-off-by: Fei Wang <fei.w.wang@intel.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Diffstat (limited to 'libavcodec/vaapi_encode.h')
-rw-r--r--libavcodec/vaapi_encode.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h
index bd25cd5c95..977bc2d946 100644
--- a/libavcodec/vaapi_encode.h
+++ b/libavcodec/vaapi_encode.h
@@ -49,6 +49,7 @@ enum {
// A.4.1: table A.6 allows at most 20 tile columns for any level.
MAX_TILE_COLS = 20,
MAX_ASYNC_DEPTH = 64,
+ MAX_REFERENCE_LIST_NUM = 2,
};
extern const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[];
@@ -116,10 +117,11 @@ typedef struct VAAPIEncodePicture {
// but not if it isn't.
int nb_dpb_pics;
struct VAAPIEncodePicture *dpb[MAX_DPB_SIZE];
- // The reference pictures used in decoding this picture. If they are
- // used by later pictures they will also appear in the DPB.
- int nb_refs;
- struct VAAPIEncodePicture *refs[MAX_PICTURE_REFERENCES];
+ // The reference pictures used in decoding this picture. If they are
+ // used by later pictures they will also appear in the DPB. ref[0][] for
+ // previous reference frames. ref[1][] for future reference frames.
+ int nb_refs[MAX_REFERENCE_LIST_NUM];
+ struct VAAPIEncodePicture *refs[MAX_REFERENCE_LIST_NUM][MAX_PICTURE_REFERENCES];
// The previous reference picture in encode order. Must be in at least
// one of the reference list and DPB list.
struct VAAPIEncodePicture *prev;
@@ -290,8 +292,9 @@ typedef struct VAAPIEncodeContext {
// Current encoding window, in display (input) order.
VAAPIEncodePicture *pic_start, *pic_end;
// The next picture to use as the previous reference picture in
- // encoding order.
- VAAPIEncodePicture *next_prev;
+ // encoding order. Order from small to large in encoding order.
+ VAAPIEncodePicture *next_prev[MAX_PICTURE_REFERENCES];
+ int nb_next_prev;
// Next input order index (display order).
int64_t input_order;