mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-14 00:58:38 +02:00
avfilter/scale_cuda: fix pitch calculation for >8 bit formats
This commit is contained in:
parent
442d53f409
commit
a1553b0cfb
@ -406,8 +406,6 @@ static int call_resize_kernel(AVFilterContext *ctx, CUfunction func, int channel
|
|||||||
&src_width, &src_height, &bit_depth, &s->param };
|
&src_width, &src_height, &bit_depth, &s->param };
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
dst_pitch /= channels;
|
|
||||||
|
|
||||||
CUDA_TEXTURE_DESC tex_desc = {
|
CUDA_TEXTURE_DESC tex_desc = {
|
||||||
.filterMode = s->interp_use_linear ?
|
.filterMode = s->interp_use_linear ?
|
||||||
CU_TR_FILTER_MODE_LINEAR :
|
CU_TR_FILTER_MODE_LINEAR :
|
||||||
@ -427,6 +425,10 @@ static int call_resize_kernel(AVFilterContext *ctx, CUfunction func, int channel
|
|||||||
.res.pitch2D.devPtr = (CUdeviceptr)src_dptr,
|
.res.pitch2D.devPtr = (CUdeviceptr)src_dptr,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handling of channels is done via vector-types in cuda, so their size is implicitly part of the pitch
|
||||||
|
// Same for pixel_size, which is represented via datatypes on the cuda side of things.
|
||||||
|
dst_pitch /= channels * pixel_size;
|
||||||
|
|
||||||
ret = CHECK_CU(cu->cuTexObjectCreate(&tex, &res_desc, &tex_desc, NULL));
|
ret = CHECK_CU(cu->cuTexObjectCreate(&tex, &res_desc, &tex_desc, NULL));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user