Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: input/common.c
- ===================================================================
- --- input/common_orig.c
- +++ input/common.c
- @@ -21,12 +21,12 @@
- #include "input.h"
- const x264_cli_csp_t x264_cli_csps[] = {
- - [X264_CSP_I420] = { "i420", 3, { 1, .5, .5 }, { 1, .5, .5 } },
- - [X264_CSP_I422] = { "i422", 3, { 1, .5, .5 }, { 1, 1, 1 } },
- - [X264_CSP_I444] = { "i444", 3, { 1, 1, 1 }, { 1, 1, 1 } },
- - [X264_CSP_YV12] = { "yv12", 3, { 1, .5, .5 }, { 1, .5, .5 } },
- - [X264_CSP_BGR] = { "bgr", 1, { 3 }, { 1 }, },
- - [X264_CSP_BGRA] = { "bgra", 1, { 4 }, { 1 }, }
- + [X264_CSP_I420] = { "i420", 3, { 1, .5, .5 }, { 1, .5, .5 }, 2, 2 },
- + [X264_CSP_I422] = { "i422", 3, { 1, .5, .5 }, { 1, 1, 1 }, 2, 1 },
- + [X264_CSP_I444] = { "i444", 3, { 1, 1, 1 }, { 1, 1, 1 }, 1, 1 },
- + [X264_CSP_YV12] = { "yv12", 3, { 1, .5, .5 }, { 1, .5, .5 }, 2, 2 },
- + [X264_CSP_BGR] = { "bgr", 1, { 3 }, { 1 }, 1, 1 },
- + [X264_CSP_BGRA] = { "bgra", 1, { 4 }, { 1 }, 1, 1 }
- };
- static int is_invalid_csp( int csp )
- Index: input/input.h
- ===================================================================
- --- input/input_orig.h
- +++ input/input.h
- @@ -109,6 +109,8 @@
- int planes;
- float width[4];
- float height[4];
- + int mod_width;
- + int mod_height;
- } x264_cli_csp_t;
- extern const x264_cli_csp_t x264_cli_csps[];
- Index: filter/resize.c
- ===================================================================
- --- filter/resize_orig.c
- +++ filter/resize.c
- @@ -65,12 +65,19 @@
- static void help( int longhelp )
- {
- - printf( " resize:widthxheight[,method]\n" );
- + printf( " resize:widthxheight[,fittobox][,method]\n" );
- if( !longhelp )
- return;
- printf( " resizes frames to the given size using resizer [\"bicubic\"]\n"
- " - fastbilinear, bilinear, bicubic, experimental, point,\n"
- - " - area, bicublin, gauss, sinc, lanczos, spline\n" );
- + " - area, bicublin, gauss, sinc, lanczos, spline\n"
- + " special-case dimensions:\n"
- + " 0 -- scale this by the same factor as the other\n"
- + " -1 -- do not scale\n"
- + " -2 -- scale this to get 1:1 sample aspect ratio\n"
- + " the fittobox option instucts this filter to fit the image\n"
- + " into a box of the given size\n"
- + " there is no padding at present\n" );
- }
- static uint32_t convert_cpu_to_flag( uint32_t cpu )
- @@ -193,11 +200,66 @@
- ;
- else if( !strcmp( opt_string, "normcsp" ) )
- h->dst_csp = pick_closest_supported_csp( info->csp );
- - else if( sscanf( opt_string, "%ux%u%n", &h->dst.width, &h->dst.height, &len ) != 2 )
- + else if( sscanf( opt_string, "%dx%d%n", &h->dst.width, &h->dst.height, &len ) != 2 )
- {
- fprintf( stderr, "resize [error]: invalid resolution %s\n", opt_string );
- return -1;
- }
- + else
- + {/* Start of special case values */
- + const int mod_w_i = x264_cli_csps[h->dst_csp].mod_width;
- + const int mod_h_i = x264_cli_csps[h->dst_csp].mod_height;
- + const float mod_w_f = mod_w_i;
- + const float mod_h_f = mod_h_i;
- +
- + /* a value of zero means we should scale this by the same factor as the other dimension */
- + if( h->dst.width == 0 )
- + h->dst.width = round( info->width * h->dst.height / (info->height * mod_w_f) ) * mod_w_i;
- +
- + /* a value of -1 means we should not scale this dimension */
- + else if( h->dst.width == -1 )
- + h->dst.width = info->width;
- +
- + /* a value of -2 means we should scale to square pixels */
- + else if( h->dst.width == -2 )
- + {
- + if( !(info->sar_width) || !(info->sar_height) )
- + {
- + fprintf(stderr, "resize [info]: cannot scale using -2 because sar is not set\n");
- + h->dst.width = info->width;
- + }
- + else
- + h->dst.width = round( info->width * info->sar_width / (info->sar_height * mod_w_f) ) * mod_w_i;
- + }
- +
- + /* a value of -3 means we should ... something
- + if( h->dst.width == -3 )
- + h->dst.width = (int)( info->width * ( (double)h->dst.height / (double)info->height ) ); */
- +
- + /* do the same for the height */
- + if( h->dst.height == 0 )
- + h->dst.height = round( info->height * h->dst.width / (info->width * mod_h_f) ) * mod_h_i;
- + else if( h->dst.height == -1 )
- + h->dst.height = info->height;
- + else if( h->dst.height == -2 )
- + {
- + if( !(info->sar_width) || !(info->sar_height) )
- + {
- + fprintf(stderr, "resize [info]: cannot scale using -2 because sar is not set\n");
- + h->dst.height = info->height;
- + }
- + else
- + h->dst.height = round( info->height * info->sar_height / (info->sar_width * mod_h_f) ) * mod_h_i;
- + }
- + if( !strcasecmp( opt_string+len+1, "fittobox" ) )
- + {
- + if( ((float)info->width / info->height) > ((float)h->dst.width / h->dst.height) )
- + h->dst.height = round( h->dst.width * info->height / (info->width * mod_h_f) ) * mod_h_i;
- + else
- + h->dst.width = round( h->dst.height * info->width / (info->height * mod_w_f) ) * mod_w_i;
- + opt_string += 9;
- + }
- + }/* End of special case values */
- opt_string += len;
- }
- else
- Index: Makefile
- ===================================================================
- --- Makefile_orig
- +++ Makefile
- @@ -17,7 +17,7 @@
- output/raw.c output/matroska.c output/matroska_ebml.c \
- output/flv.c output/flv_bytestream.c filter/source.c \
- filter/filter.c filter/cache.c filter/select_every.c \
- - filter/resize.c filter/utils.c filter/fix_vfr_pts.c
- + filter/resize.c filter/utils.c filter/fix_vfr_pts.c filter/crop.c filter/hqdn3d.c
- SRCSO =
- Index: configure
- ===================================================================
- --- configure_orig
- +++ configure
- @@ -787,7 +787,7 @@
- Cflags: -I$includedir
- EOF
- -filters="select_every"
- +filters="select_every crop hqdn3d"
- [ $swscale = yes ] && filters="resize $filters"
- cat > conftest.log <<EOF
- Index: filter/crop.c
- ===================================================================
- --- /dev/null
- +++ filter/crop.c
- @@ -0,0 +1,126 @@
- +/*****************************************************************************
- + * crop.c: x264 crop filter
- + *****************************************************************************
- + * Copyright (C) 2010 James Darnley
- + *
- + * This program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation; either version 2 of the License, or
- + * (at your option) any later version.
- + *
- + * This program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with this program; if not, write to the Free Software
- + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
- + *****************************************************************************/
- +
- +#include "filter.h"
- +
- +cli_vid_filter_t crop_filter;
- +
- +typedef struct
- +{
- + hnd_t prev_hnd;
- + cli_vid_filter_t prev_filter;
- + int left;
- + int top;
- + int width;
- + int height;
- +} crop_hnd_t;
- +
- +static void help( int longhelp )
- +{
- + printf( " crop:left,top,right,bottom\n" );
- + if(!longhelp)
- + return;
- + printf( " Crops the picture\n"
- + " removes pixels from the edges of the frame\n" );
- +}
- +
- +static int init( hnd_t *handle, cli_vid_filter_t *filter, video_info_t *info, x264_param_t *param, char *opt_string )
- +{
- + const int mod_w = x264_cli_csps[info->csp].mod_width;
- + const int mod_h = x264_cli_csps[info->csp].mod_height;
- + crop_hnd_t *h = calloc( 1, sizeof(crop_hnd_t) );
- + if(!h) return -1;
- +
- + if( sscanf( opt_string, "%u,%u,%u,%u", &h->left, &h->top, &h->width, &h->height ) != 4 )
- + {
- + fprintf( stderr, "crop [error]: invalid crop value(s) %s\n", opt_string );
- + return -1;
- + }
- + if( h->left % mod_w || h->top % mod_h || h->width % mod_w || h->height % mod_h )
- + {
- + fprintf( stderr, "crop [error]: crop values must be multiples of %d for width and %d for height\n", mod_w, mod_h );
- + return -1;
- + }
- + /* check correctness of output */
- + if( h->left + h->width >= info->width || h->top + h->height >= info->height )
- + {
- + fprintf( stderr, "crop [error]: invalid output size (%dx%d)\n",
- + info->width - h->left - h->width, info->height - h->top - h->height );
- + return -1;
- + }
- + if( info->interlaced && h->top % (mod_h*2) )
- + fprintf( stderr, "crop [warning]: top crop should be a multiple of %d for interlaced pictures\n", mod_h*2 );
- + //did I miss anything
- +
- + h->width = info->width - h->left - h->width;
- + h->height = info->height - h->top - h->height;
- +
- + fprintf( stderr, "crop [info]: output %dx%d\n", h->width, h->height );
- +
- + info->width = h->width;
- + info->height = h->height;
- +
- + h->prev_filter = *filter;
- + h->prev_hnd = *handle;
- + *handle = h;
- + *filter = crop_filter;
- + return 0;
- +}
- +
- +static int get_frame( hnd_t handle, cli_pic_t *output, int frame )
- +{
- + crop_hnd_t *h = handle;
- + if( h->prev_filter.get_frame( h->prev_hnd, output, frame ) )
- + return -1;
- + const int planes = output->img.planes;
- + const int colourspace = output->img.csp;
- + output->img.width = h->width;
- + output->img.height = h->height;
- + for( int i=0; i<planes; i++ )
- + {
- + float scale_w = x264_cli_csps[colourspace].width[i];
- + float scale_h = x264_cli_csps[colourspace].height[i];
- + output->img.plane[i] += (int)( (output->img.stride[i] * h->top*scale_h) + h->left*scale_w );
- + }
- + return 0;
- +}
- +
- +static int release_frame( hnd_t handle, cli_pic_t *pic, int frame )
- +{
- + crop_hnd_t *h = handle;
- + const int planes = pic->img.planes;
- + const int colourspace = pic->img.csp;
- + for( int i=0; i<planes; i++ )
- + {
- + float scale_w = x264_cli_csps[colourspace].width[i];
- + float scale_h = x264_cli_csps[colourspace].height[i];
- + pic->img.plane[i] -= (int)( (pic->img.stride[i] * h->top*scale_h) + h->left*scale_w );
- + }
- + return h->prev_filter.release_frame( h->prev_hnd, pic, frame );
- +}
- +
- +static void free_filter( hnd_t handle )
- +{
- + crop_hnd_t *h = handle;
- + h->prev_filter.free( h->prev_hnd );
- + free( h );
- +}
- +
- +cli_vid_filter_t crop_filter = { "crop", help, init, get_frame, release_frame, free_filter, NULL };
- Index: filter/filter.c
- ===================================================================
- --- filter/filter_orig.c
- +++ filter/filter.c
- @@ -46,6 +46,8 @@
- REGISTER_VFILTER( fix_vfr_pts );
- REGISTER_VFILTER( resize );
- REGISTER_VFILTER( select_every );
- + REGISTER_VFILTER( crop );
- + REGISTER_VFILTER( hqdn3d );
- }
- int x264_init_vid_filter( const char *name, hnd_t *handle, cli_vid_filter_t *filter,
- Index: filter/hqdn3d.c
- ===================================================================
- --- /dev/null
- +++ filter/hqdn3d.c
- @@ -0,0 +1,297 @@
- +/*****************************************************************************
- + * hqdn3d.c: x264 hqdn3d filter
- + *****************************************************************************
- + * Copyright (C) 2003 Daniel Moreno <comac@comac.darktech.org>
- + * Avisynth port (C) 2005 Loren Merritt <lorenm@u.washington.edu>
- + * x264 port (C) 2010 James Darnley <james.darnley@gmail.com>
- + *
- + * This program is free software; you can redistribute it and/or modify
- + * it under the terms of the GNU General Public License as published by
- + * the Free Software Foundation; either version 2 of the License, or
- + * (at your option) any later version.
- + *
- + * This program is distributed in the hope that it will be useful,
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- + * GNU General Public License for more details.
- + *
- + * You should have received a copy of the GNU General Public License
- + * along with this program; if not, write to the Free Software
- + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
- + *****************************************************************************/
- +
- +#include <math.h>
- +#include "filter.h"
- +
- +#define PARAM1_DEFAULT 4.0
- +#define PARAM2_DEFAULT 3.0
- +#define PARAM3_DEFAULT 6.0
- +
- +cli_vid_filter_t hqdn3d_filter;
- +
- +typedef struct
- +{
- + hnd_t prev_hnd;
- + cli_vid_filter_t prev_filter;
- + int Coefs[4][512*16];
- + unsigned int *Line;
- + unsigned short *Frame[3];
- + int w, h, cw, ch, first_frame;
- +} hqdn3d_hnd_t;
- +
- +static void help( int longhelp )
- +{
- + printf( " hqdn3d:ls,cs,lt,ct\n" );
- + if(!longhelp)
- + return;
- + printf( " Denoises the image using mplayer's hqdn3d filter\n"
- + " The four arguments are floats and are optional\n"
- + " If any options are omitted, they will assume a\n"
- + " value based on any other options that you did specify\n"
- + " - ls = luma spatial filter strength [%.1lf]\n"
- + " - cs = chroma spatial filter strength [%.1lf]\n"
- + " - lt = luma temporal filter strength [%.1lf]\n"
- + " - ct = chroma temporal filter strength [%.1lf]\n",
- + PARAM1_DEFAULT, PARAM2_DEFAULT, PARAM3_DEFAULT,
- + PARAM3_DEFAULT * PARAM2_DEFAULT / PARAM1_DEFAULT);
- +}
- +
- +#define ABS(A) ( (A) > 0 ? (A) : -(A) )
- +
- +static void PrecalcCoefs(int *Ct, double Dist25)
- +{
- + //int i;
- + double Gamma, Simil, C;
- +
- + Gamma = log(0.25) / log(1.0 - Dist25/255.0 - 0.00001);
- +
- + for (int i = -255*16; i < 256*16; i++)
- + {
- + Simil = 1.0 - ABS(i) / (16*255.0);
- + C = pow(Simil, Gamma) * 65536.0 * (double)i / 16.0;
- + Ct[16*256+i] = (int)((C<0) ? (C-0.5) : (C+0.5));
- + }
- +}
- +
- +static int init( hnd_t *handle, cli_vid_filter_t *filter, video_info_t *info,
- + x264_param_t *param, char *opt_string )
- +{
- + double LumSpac, LumTmp, ChromSpac, ChromTmp;
- + double Param1, Param2, Param3, Param4;
- +
- + hqdn3d_hnd_t *h = calloc( 1, sizeof(hqdn3d_hnd_t) );
- + if( !h )
- + {
- + fprintf( stderr, "hqdn3d [error]: Memory allocation error (filter/hqdn3d.c:%d)\n", __LINE__ );
- + return -1;
- + }
- +
- + h->w = info->width*x264_cli_csps[info->csp].width[0];
- + h->h = info->height*x264_cli_csps[info->csp].height[0];
- + h->cw = info->width*x264_cli_csps[info->csp].width[1];
- + h->ch = info->height*x264_cli_csps[info->csp].height[1];
- +
- + h->Line = calloc( 1, info->width*sizeof(int) );
- + h->Frame[0] = malloc( h->w * h->h * sizeof(short) );
- + h->Frame[1] = malloc( h->cw * h->ch * sizeof(short) );
- + h->Frame[2] = malloc( h->cw * h->ch * sizeof(short) );
- + if( !h->Line || !h->Frame[0] || !h->Frame[1] || !h->Frame[2] )
- + {
- + fprintf( stderr, "hqdn3d [error]: Memory allocation error"
- + " (filter/hqdn3d.c:%d)\n", __LINE__ );
- + return -1;
- + }
- +
- + if( !(info->csp & ( X264_CSP_I420|X264_CSP_I422
- + |X264_CSP_I444|X264_CSP_YV12 )) )
- + {
- + fprintf( stderr, "hqdn3d [error]: Only planar YUV images supported\n" );
- + return -1;
- + }
- + if(opt_string)
- + {
- + switch(sscanf( opt_string, "%lf,%lf,%lf,%lf",
- + &Param1, &Param2, &Param3, &Param4 ))
- + {
- + case 1:
- + LumSpac = Param1;
- + LumTmp = PARAM3_DEFAULT * Param1 / PARAM1_DEFAULT;
- + ChromSpac = PARAM2_DEFAULT * Param1 / PARAM1_DEFAULT;
- + ChromTmp = LumTmp * ChromSpac / LumSpac;
- + break;
- + case 2:
- + LumSpac = Param1;
- + LumTmp = PARAM3_DEFAULT * Param1 / PARAM1_DEFAULT;
- + ChromSpac = Param2;
- + ChromTmp = LumTmp * ChromSpac / LumSpac;
- + break;
- + case 3:
- + LumSpac = Param1;
- + LumTmp = Param3;
- + ChromSpac = Param2;
- + ChromTmp = LumTmp * ChromSpac / LumSpac;
- + break;
- + case 4:
- + LumSpac = Param1;
- + LumTmp = Param3;
- + ChromSpac = Param2;
- + ChromTmp = Param4;
- + break;
- + default:
- + LumSpac = PARAM1_DEFAULT;
- + LumTmp = PARAM3_DEFAULT;
- + ChromSpac = PARAM2_DEFAULT;
- + ChromTmp = LumTmp * ChromSpac / LumSpac;
- + }
- + }
- + else
- + {
- + LumSpac = PARAM1_DEFAULT;
- + LumTmp = PARAM3_DEFAULT;
- + ChromSpac = PARAM2_DEFAULT;
- + ChromTmp = LumTmp * ChromSpac / LumSpac;
- + }
- +
- + PrecalcCoefs(h->Coefs[0], LumSpac);
- + PrecalcCoefs(h->Coefs[1], LumTmp);
- + PrecalcCoefs(h->Coefs[2], ChromSpac);
- + PrecalcCoefs(h->Coefs[3], ChromTmp);
- +
- + fprintf( stderr, "hqdn3d [info]: using strengths %.1lf,%.1lf,%.1lf,%.1lf\n",
- + LumSpac, ChromSpac, LumTmp, ChromTmp );
- +
- + h->first_frame = 1;
- + h->prev_filter = *filter;
- + h->prev_hnd = *handle;
- + *handle = h;
- + *filter = hqdn3d_filter;
- + return 0;
- +}
- +
- +static inline unsigned int LowPassMul(unsigned int PrevMul, unsigned int CurrMul, int* Coef)
- +{
- +// int dMul= (PrevMul&0xFFFFFF)-(CurrMul&0xFFFFFF);
- + int dMul= PrevMul-CurrMul;
- + int d=((dMul+0x10007FF)/(65536/16));
- + return CurrMul + Coef[d];
- +}
- +
- +static void deNoise(const unsigned char *Frame, // mpi->planes[x]
- + unsigned char *FrameDest, // dmpi->planes[x]
- + unsigned int *LineAnt, // vf->priv->Line (width bytes)
- + unsigned short *FrameAnt,
- + int W, int H, int sStride, int dStride,
- + int *Horizontal, int *Vertical, int *Temporal)
- +{
- + //int X, Y;
- + int sLineOffs = 0, dLineOffs = 0;
- + unsigned int PixelAnt;
- + int PixelDst;
- +
- + /* First pixel has no left nor top neightbour. Only previous frame */
- + LineAnt[0] = PixelAnt = Frame[0]<<16;
- + PixelDst = LowPassMul(FrameAnt[0]<<8, PixelAnt, Temporal);
- + FrameAnt[0] = ((PixelDst+0x1000007F)/256);
- + FrameDest[0]= ((PixelDst+0x10007FFF)/65536);
- +
- + /* Fist line has no top neightbour. Only left one for each pixel and
- + * last frame */
- + for (int X = 1; X < W; X++){
- + LineAnt[X] = PixelAnt = LowPassMul(PixelAnt, Frame[X]<<16, Horizontal);
- + PixelDst = LowPassMul(FrameAnt[X]<<8, PixelAnt, Temporal);
- + FrameAnt[X] = ((PixelDst+0x1000007F)/256);
- + FrameDest[X]= ((PixelDst+0x10007FFF)/65536);
- + }
- +
- + for (int Y = 1; Y < H; Y++){
- + unsigned int PixelAnt;
- + unsigned short* LinePrev=&FrameAnt[Y*W];
- + sLineOffs += sStride, dLineOffs += dStride;
- + /* First pixel on each line doesn't have previous pixel */
- + PixelAnt = Frame[sLineOffs]<<16;
- + LineAnt[0] = LowPassMul(LineAnt[0], PixelAnt, Vertical);
- + PixelDst = LowPassMul(LinePrev[0]<<8, LineAnt[0], Temporal);
- + LinePrev[0] = ((PixelDst+0x1000007F)/256);
- + FrameDest[dLineOffs]= ((PixelDst+0x10007FFF)/65536);
- +
- + for (int X = 1; X < W; X++){
- + int PixelDst;
- + /* The rest are normal */
- + PixelAnt = LowPassMul(PixelAnt, Frame[sLineOffs+X]<<16, Horizontal);
- + LineAnt[X] = LowPassMul(LineAnt[X], PixelAnt, Vertical);
- + PixelDst = LowPassMul(LinePrev[X]<<8, LineAnt[X], Temporal);
- + LinePrev[X] = ((PixelDst+0x1000007F)/256);
- + FrameDest[dLineOffs+X]= ((PixelDst+0x10007FFF)/65536);
- + }
- + }
- +}
- +
- +static int get_frame( hnd_t handle, cli_pic_t *output, int frame )
- +{
- + hqdn3d_hnd_t *h = handle;
- +
- + if( h->prev_filter.get_frame( h->prev_hnd, output, frame ) )
- + return -1;
- +
- + if( h->first_frame )
- + {
- + int width = h->w;
- + int height = h->h;
- + int stride = output->img.stride[0];
- + for(int y = 0; y<height; y++)
- + for(int x = 0; x<width; x++)
- + h->Frame[0][y*width+x] = output->img.plane[0][y*stride+x] << 8;
- +
- + width = h->cw;
- + height = h->ch;
- + stride = output->img.stride[1];
- + for(int y = 0; y<height; y++)
- + for(int x = 0; x<width; x++)
- + h->Frame[1][y*width+x] = output->img.plane[1][y*stride+x] << 8;
- +
- + stride = output->img.stride[2];
- + for(int y = 0; y<height; y++)
- + for(int x = 0; x<width; x++)
- + h->Frame[2][y*width+x] = output->img.plane[2][y*stride+x] << 8;
- +
- + h->first_frame = 0;
- + }
- +
- + deNoise(output->img.plane[0],
- + output->img.plane[0],
- + h->Line, h->Frame[0],
- + h->w, h->h,
- + output->img.stride[0], output->img.stride[0],
- + h->Coefs[0], h->Coefs[0], h->Coefs[1]);
- + deNoise(output->img.plane[1],
- + output->img.plane[1],
- + h->Line, h->Frame[1],
- + h->cw, h->ch,
- + output->img.stride[1], output->img.stride[1],
- + h->Coefs[2], h->Coefs[2], h->Coefs[3]);
- + deNoise(output->img.plane[2],
- + output->img.plane[2],
- + h->Line, h->Frame[2],
- + h->cw, h->ch,
- + output->img.stride[2], output->img.stride[2],
- + h->Coefs[2], h->Coefs[2], h->Coefs[3]);
- + return 0;
- +}
- +
- +static int release_frame( hnd_t handle, cli_pic_t *pic, int frame )
- +{
- + hqdn3d_hnd_t *h = handle;
- + return h->prev_filter.release_frame( h->prev_hnd, pic, frame );
- +}
- +
- +static void free_filter( hnd_t handle )
- +{
- + hqdn3d_hnd_t *h = handle;
- + h->prev_filter.free( h->prev_hnd );
- + free( h->Line );
- + for(int i = 0; i<3; i++)
- + free( h->Frame[i] );
- + free( h );
- +}
- +
- +cli_vid_filter_t hqdn3d_filter = { "hqdn3d", help, init, get_frame, release_frame, free_filter, NULL };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement