27 #include "libavutil/avassert.h"
28 #include "libavutil/opt.h"
31 #include "libpostproc/postprocess.h"
41 #define OFFSET(x) offsetof(PPFilterContext, x)
42 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
69 if (!strcmp(cmd,
"quality")) {
116 const int aligned_w =
FFALIGN(outlink->
w, 8);
117 const int aligned_h =
FFALIGN(outlink->
h, 8);
119 int qstride, qp_type;
134 aligned_w, outlink->
h,
184 .priv_class = &pp_class,
static av_cold void pp_uninit(AVFilterContext *ctx)
This structure describes decoded (raw) audio or video data.
const char * name
Filter name.
void * priv
private data for use by the filter
static const AVFilterPad outputs[]
static av_cold int init(AVCodecContext *avctx)
void pp_free_context(pp_context *ppContext)
int h
agreed upon image height
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
static int query_formats(AVFilterContext *ctx)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
pp_context * pp_get_context(int width, int height, int flags)
#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[]
static const AVOption pp_options[]
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
static av_cold int uninit(AVCodecContext *avctx)
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
static av_cold int pp_init(AVFilterContext *ctx)
A filter pad used for either input or output.
A link between two filters.
int width
width and height of the video frame
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
pp_mode * pp_get_mode_by_name_and_quality(const char *name, int quality)
Return a pp_mode or NULL if an error occurred.
int w
agreed upon image width
enum AVPictureType pict_type
Picture type of the frame.
#define PP_PICT_TYPE_QP2
MPEG2 style QScale.
void pp_free_mode(pp_mode *mode)
static int process_command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
static const AVFilterPad pp_inputs[]
int format
agreed upon media format
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_...
AVFilterLink ** outputs
array of pointers to output links
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Describe the class of an AVClass context structure.
static int pp_filter_frame(AVFilterLink *inlink, AVFrame *inbuf)
static const AVFilterPad inputs[]
int8_t * av_frame_get_qp_table(AVFrame *f, int *stride, int *type)
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
AVFilterContext * dst
dest filter
static const SiprModeParam modes[MODE_COUNT]
static int pp_query_formats(AVFilterContext *ctx)
#define AVFILTER_DEFINE_CLASS(fname)
void pp_postprocess(const uint8_t *src[3], const int srcStride[3], uint8_t *dst[3], const int dstStride[3], int horizontalSize, int verticalSize, const QP_STORE_T *QP_store, int QP_stride, pp_mode *mode, pp_context *ppContext, int pict_type)
static int pp_process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
pp_mode * modes[PP_QUALITY_MAX+1]
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_...
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int pp_config_props(AVFilterLink *inlink)