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
604 q->extco2.Trellis = q->trellis;604 q->extco2.Trellis = q->trellis;
605#endif605#endif
606 606
607#if QSV_HAVE_LA_DS
608 q->extco2.LookAheadDS = q->la_ds;
609#endif
610
607#if QSV_HAVE_BREF_TYPE611#if QSV_HAVE_BREF_TYPE
608#if FF_API_PRIVATE_OPT612#if FF_API_PRIVATE_OPT
609FF_DISABLE_DEPRECATION_WARNINGS613FF_DISABLE_DEPRECATION_WARNINGS
libavcodec/qsvenc.h+13−0
@@ -42,6 +42,7 @@ · 41 unmodified lines
42#define QSV_HAVE_BREF_TYPE QSV_VERSION_ATLEAST(1, 8)42#define QSV_HAVE_BREF_TYPE QSV_VERSION_ATLEAST(1, 8)
43 43
44#define QSV_HAVE_LA QSV_VERSION_ATLEAST(1, 7)44#define QSV_HAVE_LA QSV_VERSION_ATLEAST(1, 7)
45#define QSV_HAVE_LA_DS QSV_VERSION_ATLEAST(1, 8)
45#define QSV_HAVE_LA_HRD QSV_VERSION_ATLEAST(1, 11)46#define QSV_HAVE_LA_HRD QSV_VERSION_ATLEAST(1, 11)
46 47
47#if defined(_WIN32)48#if defined(_WIN32)
@@ -54,6 +55,12 @@ · 6 unmodified lines
54#define QSV_HAVE_QVBR 055#define QSV_HAVE_QVBR 0
55#endif56#endif
56 57
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
57#define QSV_COMMON_OPTS \64#define QSV_COMMON_OPTS \
58{ "async_depth", "Maximum processing parallelism", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 0, INT_MAX, VE }, \65{ "async_depth", "Maximum processing parallelism", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 0, INT_MAX, VE }, \
59{ "avbr_accuracy", "Accuracy of the AVBR ratecontrol", OFFSET(qsv.avbr_accuracy), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, \66{ "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
64{ "slow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_QUALITY }, INT_MIN, INT_MAX, VE, "preset" }, \71{ "slow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_QUALITY }, INT_MIN, INT_MAX, VE, "preset" }, \
65{ "la_depth", "Number of frames to analyze before encoding.", OFFSET(qsv.la_depth), AV_OPT_TYPE_INT, { .i64 = 9 }, 9, 100, VE, "la_depth" }, \72{ "la_depth", "Number of frames to analyze before encoding.", OFFSET(qsv.la_depth), AV_OPT_TYPE_INT, { .i64 = 9 }, 9, 100, VE, "la_depth" }, \
66{ "unset", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 9 }, INT_MIN, INT_MAX, VE, "la_depth" }, \73{ "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" }, \
67{ "vcm", "Use the video conferencing mode ratecontrol", OFFSET(qsv.vcm), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, \79{ "vcm", "Use the video conferencing mode ratecontrol", OFFSET(qsv.vcm), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, \
68{ "rdo", "Enable rate distortion optimization", OFFSET(qsv.rdo), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \80{ "rdo", "Enable rate distortion optimization", OFFSET(qsv.rdo), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, \
69{ "max_frame_size", "Maximum encoded frame size in bytes", OFFSET(qsv.max_frame_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, UINT16_MAX, VE }, \81{ "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
116 int avbr_accuracy;128 int avbr_accuracy;
117 int avbr_convergence;129 int avbr_convergence;
118 int la_depth;130 int la_depth;
131 int la_ds;
119 int vcm;132 int vcm;
120 int rdo;133 int rdo;
121 int max_frame_size;134 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