diff options
author | wm4 <wm4@nowhere> | 2014-04-29 15:07:21 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-05-02 01:08:02 +0200 |
commit | ec60669cd10d726054bb5472cfe4eedf6010d154 (patch) | |
tree | 276b55c08cdb64d755628714338c62fc721cf037 /video/vdpau_mixer.h | |
parent | 7fc999b5777696c552e8b1b587aa55821e30bda2 (diff) | |
download | mpv-ec60669cd10d726054bb5472cfe4eedf6010d154.tar.bz2 mpv-ec60669cd10d726054bb5472cfe4eedf6010d154.tar.xz |
vdpau: add a postprocessing pseudo-filter
This factors out some code from vo_vdpau.c, especially deinterlacing
handling. The intention is to use this for vo_vdpau.c to make the logic
significantly easier, and to use it for vo_opengl (gl_hwdec_vdpau.c) to
allow selecting deinterlace and postprocessing modes.
As of this commit, the filter actually does nothing, since both vo_vdpau
and vo_opengl treat the generated images as normal vdpau images. This
will change in the following commits.
Diffstat (limited to 'video/vdpau_mixer.h')
-rw-r--r-- | video/vdpau_mixer.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/video/vdpau_mixer.h b/video/vdpau_mixer.h new file mode 100644 index 0000000000..80ba978373 --- /dev/null +++ b/video/vdpau_mixer.h @@ -0,0 +1,57 @@ +#ifndef MP_VDPAU_MIXER_H_ +#define MP_VDPAU_MIXER_H_ + +#include <stdbool.h> + +#include "mp_image.h" +#include "vdpau.h" + +struct mp_vdpau_mixer_opts { + int deint; + int chroma_deint; + int pullup; + float denoise; + float sharpen; + int hqscaling; +}; + +#define MP_VDP_HISTORY_FRAMES 2 + +struct mp_vdpau_mixer_frame { + // settings + struct mp_vdpau_mixer_opts opts; + // video data + VdpVideoMixerPictureStructure field; + VdpVideoSurface past[MP_VDP_HISTORY_FRAMES]; + VdpVideoSurface current; + VdpVideoSurface future[MP_VDP_HISTORY_FRAMES]; +}; + +struct mp_vdpau_mixer { + struct mp_log *log; + struct mp_vdpau_ctx *ctx; + bool initialized; + + struct mp_image_params image_params; + struct mp_vdpau_mixer_opts opts; + VdpChromaType chroma_type; + + // set initialized=false to force reinit when changed + struct mp_csp_equalizer video_eq; + + VdpVideoMixer video_mixer; +}; + +struct mp_image *mp_vdpau_mixed_frame_create(struct mp_image *base); + +struct mp_vdpau_mixer_frame *mp_vdpau_mixed_frame_get(struct mp_image *mpi); + +struct mp_vdpau_mixer *mp_vdpau_mixer_create(struct mp_vdpau_ctx *vdp_ctx, + struct mp_log *log); +void mp_vdpau_mixer_destroy(struct mp_vdpau_mixer *mixer); + +int mp_vdpau_mixer_render(struct mp_vdpau_mixer *mixer, + VdpOutputSurface output, VdpRect *output_rect, + struct mp_image *video, VdpRect *video_rect); + +#endif |