41 #define OFFSET(x) offsetof(PPFilterContext, x)
42 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
65 char *res,
int res_len,
int flags)
69 if (!strcmp(cmd,
"quality")) {
126 const int aligned_w =
FFALIGN(outlink->
w, 8);
127 const int aligned_h =
FFALIGN(outlink->
h, 8);
129 int qstride, qp_type;
144 aligned_w, outlink->
h,
194 .priv_class = &pp_class,
static av_cold void pp_uninit(AVFilterContext *ctx)
This structure describes decoded (raw) audio or video data.
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
static av_cold int init(AVCodecContext *avctx)
av_cold void pp_free_context(void *vc)
int h
agreed upon image height
pp_mode * pp_get_mode_by_name_and_quality(const char *name, int quality)
Return a pp_mode or NULL if an error occurred.
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
av_cold pp_context * pp_get_context(int width, int height, int cpuCaps)
#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC
Some filters support a generic "enable" expression option that can be used to enable or disable a fil...
const char * name
Pad name.
static const AVFilterPad pp_outputs[]
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static const AVOption pp_options[]
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
void pp_postprocess(const uint8_t *src[3], const int srcStride[3], uint8_t *dst[3], const int dstStride[3], int width, int height, const int8_t *QP_store, int QPStride, pp_mode *vm, void *vc, int pict_type)
static av_cold int uninit(AVCodecContext *avctx)
static av_cold int pp_init(AVFilterContext *ctx)
planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range...
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
A filter pad used for either input or output.
A link between two filters.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
simple assert() macros that are a bit more flexible than ISO C assert().
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
int w
agreed upon image width
enum AVPictureType pict_type
Picture type of the frame.
#define PP_PICT_TYPE_QP2
MPEG2 style QScale.
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
void pp_free_mode(pp_mode *mode)
static const AVFilterPad inputs[]
static const AVFilterPad pp_inputs[]
static const AVFilterPad outputs[]
int format
agreed upon media format
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Describe the class of an AVClass context structure.
static int pp_filter_frame(AVFilterLink *inlink, AVFrame *inbuf)
const char * name
Filter name.
AVFilterLink ** outputs
array of pointers to output links
static enum AVPixelFormat pix_fmts[]
#define flags(name, subs,...)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static int query_formats(AVFilterContext *ctx)
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
AVFilterContext * dst
dest filter
static int pp_query_formats(AVFilterContext *ctx)
static int pp_process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
int8_t * av_frame_get_qp_table(AVFrame *f, int *stride, int *type)
pp_mode * modes[PP_QUALITY_MAX+1]
#define AVERROR_EXTERNAL
Generic error in an external library.
AVPixelFormat
Pixel format.
static int pp_config_props(AVFilterLink *inlink)
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
AVFILTER_DEFINE_CLASS(pp)