You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avfilter/vf_mcdeint: add yuv444p support to mcdeint
Signed-off-by: Ethan Halsall <ethanhalsall11@augustana.edu> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
Michael Niedermayer
parent
fb65ecbc9b
commit
3f1f9db7f5
@@ -51,6 +51,7 @@
|
||||
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "avfilter.h"
|
||||
#include "filters.h"
|
||||
#include "video.h"
|
||||
@@ -128,7 +129,7 @@ static int config_props(AVFilterLink *inlink)
|
||||
enc_ctx->time_base = (AVRational){1,25}; // meaningless
|
||||
enc_ctx->gop_size = INT_MAX;
|
||||
enc_ctx->max_b_frames = 0;
|
||||
enc_ctx->pix_fmt = AV_PIX_FMT_YUV420P;
|
||||
enc_ctx->pix_fmt = inlink->format;
|
||||
enc_ctx->flags = AV_CODEC_FLAG_QSCALE | AV_CODEC_FLAG_LOW_DELAY | AV_CODEC_FLAG_RECON_FRAME;
|
||||
enc_ctx->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
|
||||
enc_ctx->global_quality = 1;
|
||||
@@ -172,6 +173,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
|
||||
AVFilterLink *outlink = inlink->dst->outputs[0];
|
||||
AVFrame *outpic, *frame_dec = mcdeint->frame_dec;
|
||||
AVPacket *pkt = mcdeint->pkt;
|
||||
const AVPixFmtDescriptor *pix_fmt_desc = av_pix_fmt_desc_get(inlink->format);
|
||||
int x, y, i, ret;
|
||||
|
||||
outpic = ff_get_video_buffer(outlink, outlink->w, outlink->h);
|
||||
@@ -201,8 +203,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
int is_chroma = !!i;
|
||||
int w = AV_CEIL_RSHIFT(inlink->w, is_chroma);
|
||||
int h = AV_CEIL_RSHIFT(inlink->h, is_chroma);
|
||||
int w, h;
|
||||
if (is_chroma) {
|
||||
w = AV_CEIL_RSHIFT(inlink->w, pix_fmt_desc->log2_chroma_w);
|
||||
h = AV_CEIL_RSHIFT(inlink->h, pix_fmt_desc->log2_chroma_h);
|
||||
} else {
|
||||
w = inlink->w;
|
||||
h = inlink->h;
|
||||
}
|
||||
int fils = frame_dec->linesize[i];
|
||||
int srcs = inpic ->linesize[i];
|
||||
int dsts = outpic ->linesize[i];
|
||||
@@ -307,5 +315,5 @@ const FFFilter ff_vf_mcdeint = {
|
||||
.uninit = uninit,
|
||||
FILTER_INPUTS(mcdeint_inputs),
|
||||
FILTER_OUTPUTS(ff_video_default_filterpad),
|
||||
FILTER_SINGLE_PIXFMT(AV_PIX_FMT_YUV420P),
|
||||
FILTER_PIXFMTS(AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P),
|
||||
};
|
||||
|
Reference in New Issue
Block a user