mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-27 17:53:13 +00:00
Merge commit 'cbe28bc069dde1d53d937ee10700bb123279c7c8'
* commit 'cbe28bc069dde1d53d937ee10700bb123279c7c8': qsv: better to use alignment by 16 and HEVC 10b requires alignment by 32 Merged-by: Mark Thompson <sw@jkqxz.net>
This commit is contained in:
commit
96cf0d8a9c
@ -475,6 +475,7 @@ int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,
|
|||||||
uint8_t *dummy_data;
|
uint8_t *dummy_data;
|
||||||
int dummy_size;
|
int dummy_size;
|
||||||
int ret;
|
int ret;
|
||||||
|
const AVPixFmtDescriptor *desc;
|
||||||
|
|
||||||
if (!q->avctx_internal) {
|
if (!q->avctx_internal) {
|
||||||
q->avctx_internal = avcodec_alloc_context3(NULL);
|
q->avctx_internal = avcodec_alloc_context3(NULL);
|
||||||
@ -501,8 +502,8 @@ int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,
|
|||||||
|
|
||||||
/* TODO: flush delayed frames on reinit */
|
/* TODO: flush delayed frames on reinit */
|
||||||
if (q->parser->format != q->orig_pix_fmt ||
|
if (q->parser->format != q->orig_pix_fmt ||
|
||||||
q->parser->coded_width != avctx->coded_width ||
|
FFALIGN(q->parser->coded_width, 16) != FFALIGN(avctx->coded_width, 16) ||
|
||||||
q->parser->coded_height != avctx->coded_height) {
|
FFALIGN(q->parser->coded_height, 16) != FFALIGN(avctx->coded_height, 16)) {
|
||||||
enum AVPixelFormat pix_fmts[3] = { AV_PIX_FMT_QSV,
|
enum AVPixelFormat pix_fmts[3] = { AV_PIX_FMT_QSV,
|
||||||
AV_PIX_FMT_NONE,
|
AV_PIX_FMT_NONE,
|
||||||
AV_PIX_FMT_NONE };
|
AV_PIX_FMT_NONE };
|
||||||
@ -521,8 +522,8 @@ int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,
|
|||||||
avctx->pix_fmt = pix_fmts[1] = qsv_format;
|
avctx->pix_fmt = pix_fmts[1] = qsv_format;
|
||||||
avctx->width = q->parser->width;
|
avctx->width = q->parser->width;
|
||||||
avctx->height = q->parser->height;
|
avctx->height = q->parser->height;
|
||||||
avctx->coded_width = q->parser->coded_width;
|
avctx->coded_width = FFALIGN(q->parser->coded_width, 16);
|
||||||
avctx->coded_height = q->parser->coded_height;
|
avctx->coded_height = FFALIGN(q->parser->coded_height, 16);
|
||||||
avctx->field_order = q->parser->field_order;
|
avctx->field_order = q->parser->field_order;
|
||||||
avctx->level = q->avctx_internal->level;
|
avctx->level = q->avctx_internal->level;
|
||||||
avctx->profile = q->avctx_internal->profile;
|
avctx->profile = q->avctx_internal->profile;
|
||||||
@ -533,6 +534,15 @@ int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,
|
|||||||
|
|
||||||
avctx->pix_fmt = ret;
|
avctx->pix_fmt = ret;
|
||||||
|
|
||||||
|
desc = av_pix_fmt_desc_get(avctx->pix_fmt);
|
||||||
|
if (!desc)
|
||||||
|
goto reinit_fail;
|
||||||
|
|
||||||
|
if (desc->comp[0].depth > 8) {
|
||||||
|
avctx->coded_width = FFALIGN(q->parser->coded_width, 32);
|
||||||
|
avctx->coded_height = FFALIGN(q->parser->coded_height, 32);
|
||||||
|
}
|
||||||
|
|
||||||
ret = qsv_decode_init(avctx, q);
|
ret = qsv_decode_init(avctx, q);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto reinit_fail;
|
goto reinit_fail;
|
||||||
|
Loading…
Reference in New Issue
Block a user