Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -406,6 +406,8 @@ static int call_resize_kernel(AVFilterContext *ctx, CUfunction func, int channel · 405 unmodified lines | ||
| 406 | 406 | &src_width, &src_height, &bit_depth, &s->param }; |
| 407 | 407 | int ret; |
| 408 | 408 | |
| 409 | + dst_pitch /= channels; | |
| 410 | + | |
| 409 | 411 | CUDA_TEXTURE_DESC tex_desc = { |
| 410 | 412 | .filterMode = s->interp_use_linear ? |
| 411 | 413 | CU_TR_FILTER_MODE_LINEAR : |
| @@ -421,7 +423,7 @@ static int call_resize_kernel(AVFilterContext *ctx, CUfunction func, int channel · 9 unmodified lines | ||
| 421 | 423 | .res.pitch2D.numChannels = channels, |
| 422 | 424 | .res.pitch2D.width = src_width, |
| 423 | 425 | .res.pitch2D.height = src_height, |
| 424 | − .res.pitch2D.pitchInBytes = src_pitch * pixel_size, | |
| 426 | + .res.pitch2D.pitchInBytes = src_pitch, | |
| 425 | 427 | .res.pitch2D.devPtr = (CUdeviceptr)src_dptr, |
| 426 | 428 | }; |
| 427 | 429 | |
| @@ -477,16 +479,16 @@ static int scalecuda_resize(AVFilterContext *ctx, · 49 unmodified lines | ||
| 477 | 479 | break; |
| 478 | 480 | case AV_PIX_FMT_YUV444P16: |
| 479 | 481 | call_resize_kernel(ctx, s->cu_func_ushort, 1, |
| 480 | − in->data[0], in->width, in->height, in->linesize[0] / 2, | |
| 481 | − out->data[0], out->width, out->height, out->linesize[0] / 2, | |
| 482 | + in->data[0], in->width, in->height, in->linesize[0], | |
| 483 | + out->data[0], out->width, out->height, out->linesize[0], | |
| 482 | 484 | 2, 16); |
| 483 | 485 | call_resize_kernel(ctx, s->cu_func_ushort, 1, |
| 484 | − in->data[1], in->width, in->height, in->linesize[1] / 2, | |
| 485 | − out->data[1], out->width, out->height, out->linesize[1] / 2, | |
| 486 | + in->data[1], in->width, in->height, in->linesize[1], | |
| 487 | + out->data[1], out->width, out->height, out->linesize[1], | |
| 486 | 488 | 2, 16); |
| 487 | 489 | call_resize_kernel(ctx, s->cu_func_ushort, 1, |
| 488 | − in->data[2], in->width, in->height, in->linesize[2] / 2, | |
| 489 | − out->data[2], out->width, out->height, out->linesize[2] / 2, | |
| 490 | + in->data[2], in->width, in->height, in->linesize[2], | |
| 491 | + out->data[2], out->width, out->height, out->linesize[2], | |
| 490 | 492 | 2, 16); |
| 491 | 493 | break; |
| 492 | 494 | case AV_PIX_FMT_NV12: |
| @@ -496,34 +498,34 @@ static int scalecuda_resize(AVFilterContext *ctx, · 3 unmodified lines | ||
| 496 | 498 | 1, 8); |
| 497 | 499 | call_resize_kernel(ctx, s->cu_func_uchar2, 2, |
| 498 | 500 | in->data[1], in->width / 2, in->height / 2, in->linesize[1], |
| 499 | − out->data[1], out->width / 2, out->height / 2, out->linesize[1] / 2, | |
| 501 | + out->data[1], out->width / 2, out->height / 2, out->linesize[1], | |
| 500 | 502 | 1, 8); |
| 501 | 503 | break; |
| 502 | 504 | case AV_PIX_FMT_P010LE: |
| 503 | 505 | call_resize_kernel(ctx, s->cu_func_ushort, 1, |
| 504 | − in->data[0], in->width, in->height, in->linesize[0] / 2, | |
| 505 | − out->data[0], out->width, out->height, out->linesize[0] / 2, | |
| 506 | + in->data[0], in->width, in->height, in->linesize[0], | |
| 507 | + out->data[0], out->width, out->height, out->linesize[0], | |
| 506 | 508 | 2, 10); |
| 507 | 509 | call_resize_kernel(ctx, s->cu_func_ushort2, 2, |
| 508 | − in->data[1], in->width / 2, in->height / 2, in->linesize[1] / 2, | |
| 509 | − out->data[1], out->width / 2, out->height / 2, out->linesize[1] / 4, | |
| 510 | + in->data[1], in->width / 2, in->height / 2, in->linesize[1], | |
| 511 | + out->data[1], out->width / 2, out->height / 2, out->linesize[1], | |
| 510 | 512 | 2, 10); |
| 511 | 513 | break; |
| 512 | 514 | case AV_PIX_FMT_P016LE: |
| 513 | 515 | call_resize_kernel(ctx, s->cu_func_ushort, 1, |
| 514 | − in->data[0], in->width, in->height, in->linesize[0] / 2, | |
| 515 | − out->data[0], out->width, out->height, out->linesize[0] / 2, | |
| 516 | + in->data[0], in->width, in->height, in->linesize[0], | |
| 517 | + out->data[0], out->width, out->height, out->linesize[0], | |
| 516 | 518 | 2, 16); |
| 517 | 519 | call_resize_kernel(ctx, s->cu_func_ushort2, 2, |
| 518 | − in->data[1], in->width / 2, in->height / 2, in->linesize[1] / 2, | |
| 519 | − out->data[1], out->width / 2, out->height / 2, out->linesize[1] / 4, | |
| 520 | + in->data[1], in->width / 2, in->height / 2, in->linesize[1], | |
| 521 | + out->data[1], out->width / 2, out->height / 2, out->linesize[1], | |
| 520 | 522 | 2, 16); |
| 521 | 523 | break; |
| 522 | 524 | case AV_PIX_FMT_0RGB32: |
| 523 | 525 | case AV_PIX_FMT_0BGR32: |
| 524 | 526 | call_resize_kernel(ctx, s->cu_func_uchar4, 4, |
| 525 | 527 | in->data[0], in->width, in->height, in->linesize[0], |
| 526 | − out->data[0], out->width, out->height, out->linesize[0] / 4, | |
| 528 | + out->data[0], out->width, out->height, out->linesize[0], | |
| 527 | 529 | 1, 8); |
| 528 | 530 | break; |
| 529 | 531 | default: |