diff mbox series

[FFmpeg-devel,1/3] lavc/qsvenc: use the right alignment instead of hard coded value

Message ID 20230518065438.144156-1-haihao.xiang@intel.com
State Accepted
Commit cfdfd6aa723101f4bf089dc750b8389b203533f8
Headers show
Series [FFmpeg-devel,1/3] lavc/qsvenc: use the right alignment instead of hard coded value | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Xiang, Haihao May 18, 2023, 6:54 a.m. UTC
From: Haihao Xiang <haihao.xiang@intel.com>

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 libavcodec/qsvenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Xiang, Haihao May 22, 2023, 1:38 a.m. UTC | #1
On Do, 2023-05-18 at 14:54 +0800, Xiang, Haihao wrote:
> From: Haihao Xiang <haihao.xiang@intel.com>
> 
> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
> ---
>  libavcodec/qsvenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
> index 0ed1f757d4..2c38fbf0dc 100644
> --- a/libavcodec/qsvenc.c
> +++ b/libavcodec/qsvenc.c
> @@ -1909,7 +1909,7 @@ static int submit_frame(QSVEncContext *q, const AVFrame
> *frame,
>      } else {
>          /* make a copy if the input is not padded as libmfx requires */
>          /* and to make allocation continious for data[0]/data[1] */
> -         if ((frame->height & 31 || frame->linesize[0] & (q->width_align -
> 1)) ||
> +         if ((frame->height & (q->height_align - 1) || frame->linesize[0] &
> (q->width_align - 1)) ||
>              (frame->data[1] - frame->data[0] != frame->linesize[0] *
> FFALIGN(qf->frame->height, q->height_align))) {
>              int tmp_w, tmp_h;
>              qf->frame->height = tmp_h = FFALIGN(frame->height, q-
> >height_align);

Will apply this patchset

- Haihao
diff mbox series

Patch

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 0ed1f757d4..2c38fbf0dc 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -1909,7 +1909,7 @@  static int submit_frame(QSVEncContext *q, const AVFrame *frame,
     } else {
         /* make a copy if the input is not padded as libmfx requires */
         /* and to make allocation continious for data[0]/data[1] */
-         if ((frame->height & 31 || frame->linesize[0] & (q->width_align - 1)) ||
+         if ((frame->height & (q->height_align - 1) || frame->linesize[0] & (q->width_align - 1)) ||
             (frame->data[1] - frame->data[0] != frame->linesize[0] * FFALIGN(qf->frame->height, q->height_align))) {
             int tmp_w, tmp_h;
             qf->frame->height = tmp_h = FFALIGN(frame->height, q->height_align);