Go to the documentation of this file.
76 #define DIV_UP(a, b) ( ((a) + (b) - 1) / (b) )
80 #define CHECK_CU(x) FF_CUDA_CHECK_DL(ctx, s->hwctx->internal->cuda_dl, x)
182 cu->cuMemFree(
filter->weights);
184 cu->cuMemFree(
filter->offsets);
192 cu->cuTexObjectDestroy(t->
tex[
i]);
194 cu->cuMemFree(t->
data[
i]);
197 memset(t, 0,
sizeof(*t));
205 CudaFunctions *cu =
s->hwctx->internal->cuda_dl;
208 CHECK_CU(cu->cuCtxPushCurrent(
s->hwctx->cuda_ctx));
217 CHECK_CU(cu->cuModuleUnload(
s->cu_module));
258 s->frames_ctx = out_ref;
269 CudaFunctions *cu =
s->hwctx->internal->cuda_dl;
276 .crop_width = out_width,
277 .crop_height = in_height,
278 .log2_chroma_w =
s->out_desc->log2_chroma_w,
279 .log2_chroma_h =
s->in_desc->log2_chroma_h,
282 for (
int i = 0;
i <
s->in_planes;
i++) {
283 const int is_chroma =
i == 1 ||
i == 2;
284 const int sub_x = is_chroma ?
s->inter_tex.log2_chroma_w : 0;
285 const int sub_y = is_chroma ?
s->inter_tex.log2_chroma_h : 0;
288 const int sizeof_pixel = (
s->in_plane_depths[
i] <= 8 ? 1 : 2) *
289 s->in_plane_channels[
i];
292 ret =
CHECK_CU(cu->cuMemAllocPitch(&
s->inter_tex.data[
i], &pitch,
293 (
size_t) plane_w * sizeof_pixel,
297 s->inter_tex.linesize[
i] = pitch;
299 CUDA_TEXTURE_DESC tex_desc = {
301 .filterMode = CU_TR_FILTER_MODE_POINT,
304 CUDA_RESOURCE_DESC res_desc = {
305 .resType = CU_RESOURCE_TYPE_PITCH2D,
306 .res.pitch2D.format =
s->in_plane_depths[
i] <= 8 ?
307 CU_AD_FORMAT_UNSIGNED_INT8 :
308 CU_AD_FORMAT_UNSIGNED_INT16,
309 .res.pitch2D.numChannels =
s->in_plane_channels[
i],
310 .res.pitch2D.devPtr =
s->inter_tex.data[
i],
311 .res.pitch2D.pitchInBytes = pitch,
312 .res.pitch2D.width = plane_w,
313 .res.pitch2D.height = plane_h,
316 ret =
CHECK_CU(cu->cuTexObjectCreate(&
s->inter_tex.tex[
i], &res_desc,
350 s->in_fmt = in_format;
351 s->out_fmt = out_format;
362 for (
i = 0;
i <
s->in_desc->nb_components;
i++) {
363 d = (
s->in_desc->comp[
i].depth + 7) / 8;
364 p =
s->in_desc->comp[
i].plane;
365 s->in_plane_channels[
p] =
FFMAX(
s->in_plane_channels[
p],
s->in_desc->comp[
i].step / d);
367 s->in_plane_depths[
p] =
s->in_desc->comp[
i].depth;
372 int out_width,
int out_height)
406 if (
s->passthrough && in_width == out_width && in_height == out_height && in_format == out_format) {
417 if (in_width == out_width && in_height == out_height &&
423 }
else if (
s->use_filters < 0 && (out_width < in_width || out_height < in_height))
437 CUcontext
dummy, cuda_ctx =
s->hwctx->cuda_ctx;
438 CudaFunctions *cu =
s->hwctx->internal->cuda_dl;
445 const char *function_infix =
"";
447 extern const unsigned char ff_vf_scale_cuda_ptx_data[];
448 extern const unsigned int ff_vf_scale_cuda_ptx_len;
450 if (
s->use_filters) {
454 function_infix =
inlink->h == outlink->
h ?
"Generic_h" :
"Generic_v";
455 s->interp_use_linear = 0;
456 s->interp_as_integer = 0;
458 switch(
s->interp_algo) {
460 function_infix =
"Nearest";
461 s->interp_use_linear = 0;
462 s->interp_as_integer = 1;
465 function_infix =
"Bilinear";
466 s->interp_use_linear = 1;
467 s->interp_as_integer = 1;
471 function_infix =
"Bicubic";
472 s->interp_use_linear = 0;
473 s->interp_as_integer = 0;
476 function_infix =
"Lanczos";
477 s->interp_use_linear = 0;
478 s->interp_as_integer = 0;
491 ff_vf_scale_cuda_ptx_data, ff_vf_scale_cuda_ptx_len);
495 snprintf(buf,
sizeof(buf),
"Subsample_%s_%s_%s", function_infix, in_fmt_name, out_fmt_name);
504 snprintf(buf,
sizeof(buf),
"Subsample_%s_%s_%s_uv", function_infix, in_fmt_name, out_fmt_name);
510 if (
s->use_filters) {
512 snprintf(buf,
sizeof(buf),
"Subsample_Generic_h_%s_%s", in_fmt_name, in_fmt_name);
517 snprintf(buf,
sizeof(buf),
"Subsample_Generic_h_%s_%s_uv", in_fmt_name, in_fmt_name);
531 int src_size,
int dst_size,
535 CudaFunctions *cu =
s->hwctx->internal->cuda_dl;
539 .src_size = src_size,
540 .dst_size = dst_size,
541 .virtual_size = virtual_size,
544 switch (
s->interp_algo) {
562 "currently supported by the CUDA scaler (%d).\n",
573 for (
size_t i = 0;
i <
weights->num_weights;
i++)
576 f->filter_size =
weights->filter_size;
577 f->dst_size = dst_size;
579 const size_t weights_size =
weights->num_weights *
sizeof(*tmp);
580 ret =
CHECK_CU(cu->cuMemAlloc(&
f->weights, weights_size));
587 const size_t offsets_size = dst_size *
sizeof(*
weights->offsets);
588 ret =
CHECK_CU(cu->cuMemAlloc(&
f->offsets, offsets_size));
596 f->filter_size,
weights->name, src_size, dst_size);
611 CudaFunctions *cu =
s->hwctx->internal->cuda_dl;
615 const int in_sub_x =
s->in_desc->log2_chroma_w;
616 const int in_sub_y =
s->in_desc->log2_chroma_h;
617 const int out_sub_x =
s->out_desc->log2_chroma_w;
618 const int out_sub_y =
s->out_desc->log2_chroma_h;
620 ret =
CHECK_CU(cu->cuCtxPushCurrent(
s->hwctx->cuda_ctx));
624 int pass_x = -1, pass_y = -1;
629 }
else if (
inlink->w != outlink->
w) {
631 }
else if (
inlink->h != outlink->
h) {
640 if (
s->in_planes > 1) {
643 const double virtual_size = (
double) outlink->
w / (1 << out_sub_x);
645 src_size, dst_size, virtual_size);
656 if (
s->in_planes > 1) {
659 const double virtual_size = (
double) outlink->
h / (1 << out_sub_y);
661 src_size, dst_size, virtual_size);
691 s->w_expr,
s->h_expr,
697 w_adj =
inlink->sample_aspect_ratio.num ?
701 s->force_original_aspect_ratio,
702 s->force_divisible_by, w_adj);
720 s->hwctx = device_hwctx;
721 s->cu_stream =
s->hwctx->stream;
725 else if (
inlink->sample_aspect_ratio.num) {
728 inlink->sample_aspect_ratio);
736 s->passthrough ?
" (passthrough)" :
"");
738 if (
s->use_filters) {
756 const int depths[4],
const int channels[4],
760 CudaFunctions *cu =
s->hwctx->internal->cuda_dl;
768 .height =
frame->height,
769 .crop_left =
frame->crop_left,
770 .crop_top =
frame->crop_top,
773 .color_range =
frame->color_range,
774 .log2_chroma_w =
desc->log2_chroma_w,
775 .log2_chroma_h =
desc->log2_chroma_h,
785 CUDA_TEXTURE_DESC tex_desc = {
786 .filterMode =
s->interp_use_linear ?
787 CU_TR_FILTER_MODE_LINEAR :
788 CU_TR_FILTER_MODE_POINT,
789 .flags =
s->interp_as_integer ? CU_TRSF_READ_AS_INTEGER : 0,
792 const int is_chroma =
i == 1 ||
i == 2;
793 const int sub_x = is_chroma ?
desc->log2_chroma_w : 0;
794 const int sub_y = is_chroma ?
desc->log2_chroma_h : 0;
795 CUDA_RESOURCE_DESC res_desc = {
796 .resType = CU_RESOURCE_TYPE_PITCH2D,
797 .res.pitch2D.format = depths[
i] <= 8 ?
798 CU_AD_FORMAT_UNSIGNED_INT8 :
799 CU_AD_FORMAT_UNSIGNED_INT16,
801 .res.pitch2D.pitchInBytes = tex->
linesize[
i],
802 .res.pitch2D.devPtr = tex->
data[
i],
818 const CUtexObject src_tex[4],
819 int src_left,
int src_top,
int src_width,
int src_height,
820 const CUdeviceptr out_data[4],
821 int dst_width,
int dst_height,
int dst_pitch,
int mpeg_range,
825 CudaFunctions *cu =
s->hwctx->internal->cuda_dl;
828 .
src_tex = {src_tex[0], src_tex[1], src_tex[2], src_tex[3]},
835 .dst_width = dst_width,
836 .dst_height = dst_height,
837 .dst_pitch = dst_pitch,
838 .src_left = src_left,
840 .src_width = src_width,
841 .src_height = src_height,
843 .mpeg_range = mpeg_range,
852 void *args[] = { ¶ms };
866 int out_planes =
s->out_planes;
868 out_planes =
s->in_planes;
875 out->linesize[0], mpeg_range,
880 if (out_planes > 1) {
890 out->linesize[1], mpeg_range,
891 &
s->filters_uv[pass]);
902 CudaFunctions *cu =
s->hwctx->internal->cuda_dl;
906 CUDATex in_tex = {0}, out_tex = {0};
916 if (
s->use_filters) {
936 s->frame->width = outlink->
w;
937 s->frame->height = outlink->
h;
959 CudaFunctions *cu =
s->hwctx->internal->cuda_dl;
974 ret =
CHECK_CU(cu->cuCtxPushCurrent(
s->hwctx->cuda_ctx));
987 av_reduce(&
out->sample_aspect_ratio.num, &
out->sample_aspect_ratio.den,
1005 return s->passthrough ?
1010 #define OFFSET(x) offsetof(CUDAScaleContext, x)
1011 #define FLAGS (AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM)
1021 {
"passthrough",
"Do not process frames at all if parameters match",
OFFSET(passthrough),
AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1,
FLAGS },
1022 {
"use_filters",
"Use generic filters instead of fixed function kernels",
OFFSET(use_filters),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1,
FLAGS, .unit =
"use_filters" },
1025 {
"force_original_aspect_ratio",
"decrease or increase w/h if necessary to keep the original AR",
OFFSET(force_original_aspect_ratio),
AV_OPT_TYPE_INT, { .i64 = 0 }, 0,
SCALE_FORCE_OAR_NB-1,
FLAGS, .unit =
"force_oar" },
1029 {
"force_divisible_by",
"enforce that the output resolution is divisible by a defined integer when force_original_aspect_ratio is used",
OFFSET(force_divisible_by),
AV_OPT_TYPE_INT, { .i64 = 1 }, 1, 256,
FLAGS },
1030 {
"reset_sar",
"reset SAR to 1 and scale to square pixels if scaling proportionally",
OFFSET(reset_sar),
AV_OPT_TYPE_BOOL, { .i64 = 0}, 0, 1,
FLAGS },
1059 .
p.
name =
"scale_cuda",
@ SCALE_FORCE_OAR_DISABLE
static const AVOption options[]
int(* func)(AVBPrint *dst, const char *in, const char *arg)
void * hwctx
The format-specific data, allocated and freed by libavutil along with this context.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
AVPixelFormat
Pixel format.
enum AVPixelFormat format
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static av_cold int cudascale_init(AVFilterContext *ctx)
static const struct format_entry supported_formats[]
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
uint8_t * data
The data buffer.
@ SWS_SCALE_BILINEAR
bilinear filtering
enum AVPixelFormat format
The pixel format identifying the underlying HW surface type.
int ff_cuda_load_module(void *avctx, AVCUDADeviceContext *hwctx, CUmodule *cu_module, const unsigned char *data, const unsigned int length)
Loads a CUDA module and applies any decompression, if necessary.
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
#define AV_PIX_FMT_YUV444P10MSB
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
static av_cold void cudascale_uninit(AVFilterContext *ctx)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
int av_hwframe_ctx_init(AVBufferRef *ref)
Finalize the context before use.
char * w_expr
width expression string
This structure describes decoded (raw) audio or video data.
@ AVCOL_RANGE_JPEG
Full range content.
AVBufferRef * av_hwframe_ctx_alloc(AVBufferRef *device_ref_in)
Allocate an AVHWFramesContext tied to a given device context.
Represents a computed filter kernel.
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
static av_cold int init_hwframe_ctx(CUDAScaleContext *s, AVBufferRef *device_ctx, int width, int height)
#define AV_PIX_FMT_YUV420P10
#define AV_LOG_VERBOSE
Detailed information.
int ff_scale_eval_dimensions(void *log_ctx, const char *w_expr, const char *h_expr, AVFilterLink *inlink, AVFilterLink *outlink, int *ret_w, int *ret_h)
Parse and evaluate string expressions for width and height.
void(* filter)(uint8_t *src, int stride, int qscale)
AVBufferRef * av_buffer_ref(const AVBufferRef *buf)
Create a new reference to an AVBuffer.
const char * name
Filter name.
static const char * get_format_name(enum AVPixelFormat fmt)
int width
The allocated dimensions of the frames in this pool.
A link between two filters.
#define AV_PIX_FMT_YUV444P12MSB
int ff_sws_filter_generate(void *log, const SwsFilterParams *params, SwsFilterWeights **out)
Generate a filter kernel for the given parameters.
Link properties exposed to filter code, but not external callers.
AVFrame * ff_default_get_video_buffer(AVFilterLink *link, int w, int h)
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
static av_cold int cudascale_load_functions(AVFilterContext *ctx)
@ AV_SIDE_DATA_PROP_SIZE_DEPENDENT
Side data depends on the video dimensions.
A filter pad used for either input or output.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_PIX_FMT_YUV444P10
@ SWS_SCALE_BICUBIC
2-tap cubic BC-spline
static const AVClass cudascale_class
static av_cold int cudascale_config_props(AVFilterLink *outlink)
AVCUDADeviceContext * hwctx
static av_cold int cudascale_setup_filters(AVFilterContext *ctx)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_cold void set_format_info(AVFilterContext *ctx, enum AVPixelFormat in_format, enum AVPixelFormat out_format)
#define FF_ARRAY_ELEMS(a)
static av_cold int inter_buf_init(AVFilterContext *ctx, int out_width, int in_height)
#define FILTER_OUTPUTS(array)
#define AV_PIX_FMT_YUV444P16
@ SWS_SCALE_LANCZOS
3-tap sinc/sinc
#define AV_CEIL_RSHIFT(a, b)
@ SWS_FILTER_SCALE
14-bit coefficients are picked to fit comfortably within int16_t for efficient SIMD processing (e....
static FilterLink * ff_filter_link(AVFilterLink *link)
#define AV_PIX_FMT_0BGR32
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
const FFFilter ff_vf_scale_cuda
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static AVFormatContext * ctx
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static int format_is_supported(enum AVPixelFormat fmt)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a link
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
enum AVPixelFormat sw_format
The pixel format identifying the actual data layout of the hardware frames.
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
New swscale design to change SwsGraph is what coordinates multiple passes These can include cascaded scaling error diffusion and so on Or we could have separate passes for the vertical and horizontal scaling In between each SwsPass lies a fully allocated image buffer Graph passes may have different levels of e g we can have a single threaded error diffusion pass following a multi threaded scaling pass SwsGraph is internally recreated whenever the image format
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
const AVPixFmtDescriptor * out_desc
char * h_expr
height expression string
Rational number (pair of numerator and denominator).
AVBufferRef * device_ref
A reference to the parent AVHWDeviceContext.
AVFilterLink ** inputs
array of pointers to input links
const char * av_default_item_name(void *ptr)
Return the context name.
#define AV_PIX_FMT_YUV422P10
static const AVFilterPad cudascale_inputs[]
#define SWS_PARAM_DEFAULT
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
CUfunction cu_func[FILTER_NB]
#define i(width, name, range_min, range_max)
static void cuda_tex_uninit(CudaFunctions *cu, CUDATex *t)
AVFilterContext * src
source filter
@ AV_PIX_FMT_NV16
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
static av_cold int cudascale_filter_init(AVFilterContext *ctx, CUDAScaleFilter *f, int src_size, int dst_size, double virtual_size)
CUDAScaleFilter filters[FILTER_NB]
void av_frame_side_data_remove_by_props(AVFrameSideData ***sd, int *nb_sd, int props)
Remove and free all side data instances that match any of the given side data properties.
AVBufferRef * hw_frames_ctx
For hwaccel pixel formats, this should be a reference to the AVHWFramesContext describing the frames.
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
CUfunction cu_func_uv[FILTER_NB]
void av_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
@ SCALE_FORCE_OAR_INCREASE
int w
agreed upon image width
static const struct @596 planes[]
#define av_malloc_array(a, b)
static const int weights[]
void av_frame_move_ref(AVFrame *dst, AVFrame *src)
Move everything contained in src to dst and reset src.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
double scaler_params[SWS_NUM_SCALER_PARAMS]
const char * name
Pad name.
static void filter_uninit(CudaFunctions *cu, CUDAScaleFilter *filter)
CUdeviceptr offsets
int[dst_size]
This struct describes a set or pool of "hardware" frames (i.e.
This struct is allocated as AVHWDeviceContext.hwctx.
enum AVPixelFormat in_fmt out_fmt
#define AV_LOG_FATAL
Something went wrong and recovery is not possible.
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
#define AV_PIX_FMT_0RGB32
AVHWDeviceContext * device_ctx
The parent AVHWDeviceContext.
#define FILTER_INPUTS(array)
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
CUDAScaleFilter filters_uv[FILTER_NB]
@ SCALE_FORCE_OAR_DECREASE
static AVFrame * cudascale_get_video_buffer(AVFilterLink *inlink, int w, int h)
int h
agreed upon image height
@ AV_OPT_TYPE_INT
Underlying C type is int.
static int call_resize_kernel(AVFilterContext *ctx, CUfunction func, const CUtexObject src_tex[4], int src_left, int src_top, int src_width, int src_height, const CUdeviceptr out_data[4], int dst_width, int dst_height, int dst_pitch, int mpeg_range, const CUDAScaleFilter *filter)
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
@ AV_OPT_TYPE_PIXEL_FMT
Underlying C type is enum AVPixelFormat.
AVRational av_mul_q(AVRational b, AVRational c)
Multiply two rationals.
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
static const AVFilterPad cudascale_outputs[]
AVFilter p
The public AVFilter.
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
A reference to a data buffer.
static int cudascale_scale(AVFilterContext *ctx, AVFrame *out, AVFrame *in)
static int cudascale_filter_frame(AVFilterLink *link, AVFrame *in)
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
int force_original_aspect_ratio
enum AVPixelFormat format
Output sw format.
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
#define SCALE_CUDA_PARAM_DEFAULT
const AVPixFmtDescriptor * in_desc
CUdeviceptr weights
float[dst_size][filter_size]
static av_cold int init_processing_chain(AVFilterContext *ctx, int in_width, int in_height, int out_width, int out_height)
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
static int cuda_tex_map_frame(AVFilterContext *ctx, const AVFrame *frame, const int depths[4], const int channels[4], CUDATex *tex)
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
int av_hwframe_get_buffer(AVBufferRef *hwframe_ref, AVFrame *frame, int flags)
Allocate a new frame attached to the given AVHWFramesContext.
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
SwsScaler scaler
The filter kernel and parameters to use.
int ff_scale_adjust_dimensions(AVFilterLink *inlink, int *ret_w, int *ret_h, int force_original_aspect_ratio, int force_divisible_by, double w_adj)
Transform evaluated width and height obtained from ff_scale_eval_dimensions into actual target width ...
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
static int scalecuda_resize(AVFilterContext *ctx, int pass, const CUDATex *out, const CUDATex *in)