History

qsv: Support explicit lookahead downscaling

Luca Barbato committed 8 years ago

Commit 50837851 parent f2e9a0e2 files · +17 −0Browse files

Unified · Split

2 files
  1. libavcodec/qsvenc.c +4 −0
  2. libavcodec/qsvenc.h +13 −0
libavcodec/qsvenc.c+4−0
@@ -604,6 +604,10 @@ FF_ENABLE_DEPRECATION_WARNINGS · 603 unmodified lines
604604 q->extco2.Trellis = q->trellis;
605605 #endif
606606
607+#if QSV_HAVE_LA_DS
608+ q->extco2.LookAheadDS = q->la_ds;
609+#endif
610+
607611 #if QSV_HAVE_BREF_TYPE
608612 #if FF_API_PRIVATE_OPT
609613 FF_DISABLE_DEPRECATION_WARNINGS
libavcodec/qsvenc.h+13−0
@@ -42,6 +42,7 @@ · 41 unmodified lines
4242 #define QSV_HAVE_BREF_TYPE QSV_VERSION_ATLEAST(1, 8)
4343
4444 #define QSV_HAVE_LA QSV_VERSION_ATLEAST(1, 7)
45+#define QSV_HAVE_LA_DS QSV_VERSION_ATLEAST(1, 8)
4546 #define QSV_HAVE_LA_HRD QSV_VERSION_ATLEAST(1, 11)
4647
4748 #if defined(_WIN32)
@@ -54,6 +55,12 @@ · 6 unmodified lines
5455 #define QSV_HAVE_QVBR 0
5556 #endif
5657
58+#if !QSV_HAVE_LA_DS
59+#define MFX_LOOKAHEAD_DS_OFF 0
60+#define MFX_LOOKAHEAD_DS_2x 0
61+#define MFX_LOOKAHEAD_DS_4x 0
62+#endif
63+
5764 #define QSV_COMMON_OPTS \
5865 { "async_depth", "Maximum processing parallelism", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 0, INT_MAX, VE }, \
5966 { "avbr_accuracy", "Accuracy of the AVBR ratecontrol", OFFSET(qsv.avbr_accuracy), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, \
@@ -64,6 +71,11 @@ · 4 unmodified lines
6471 { "slow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_QUALITY }, INT_MIN, INT_MAX, VE, "preset" }, \
6572 { "la_depth", "Number of frames to analyze before encoding.", OFFSET(qsv.la_depth), AV_OPT_TYPE_INT, { .i64 = 9 }, 9, 100, VE, "la_depth" }, \
6673 { "unset", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 9 }, INT_MIN, INT_MAX, VE, "la_depth" }, \
74+{ "la_ds", "Downscaling factor for the frames saved for the lookahead analysis", OFFSET(qsv.la_ds), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, MFX_LOOKAHEAD_DS_4x, VE, "la_ds" }, \
75+{ "auto", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, INT_MIN, INT_MAX, VE, "la_ds" }, \
76+{ "off", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_LOOKAHEAD_DS_OFF }, INT_MIN, INT_MAX, VE, "la_ds" }, \
77+{ "2x", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_LOOKAHEAD_DS_2x }, INT_MIN, INT_MAX, VE, "la_ds" }, \
78+{ "4x", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_LOOKAHEAD_DS_4x }, INT_MIN, INT_MAX, VE, "la_ds" }, \
6779 { "vcm", "Use the video conferencing mode ratecontrol", OFFSET(qsv.vcm), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, \
6880 { "rdo", "Enable rate distortion optimization", OFFSET(qsv.rdo), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
6981 { "max_frame_size", "Maximum encoded frame size in bytes", OFFSET(qsv.max_frame_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, UINT16_MAX, VE }, \
@@ -116,6 +128,7 @@ typedef struct QSVEncContext { · 46 unmodified lines
116128 int avbr_accuracy;
117129 int avbr_convergence;
118130 int la_depth;
131+ int la_ds;
119132 int vcm;
120133 int rdo;
121134 int max_frame_size;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t