#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_vout.h>
#include <vlc_filter.h>
#ifdef HAVE_LIBSWSCALE_SWSCALE_H
set_subcategory( SUBCAT_VIDEO_VFILTER )
set_callbacks( OpenScaler, CloseScaler )
add_integer( "swscale-mode", 2, NULL, SCALEMODE_TEXT, SCALEMODE_LONGTEXT, true )
- change_integer_list( pi_mode_values, ppsz_mode_descriptions, NULL );
+ change_integer_list( pi_mode_values, ppsz_mode_descriptions, NULL )
vlc_module_end ()
/* Version checking */
if( p_fmti->i_chroma == p_fmto->i_chroma )
{
- if( p_fmti->i_chroma == VLC_FOURCC( 'Y', 'U', 'V', 'P' ) && ALLOW_YUVP )
+ if( p_fmti->i_chroma == VLC_CODEC_YUVP && ALLOW_YUVP )
{
i_fmti = i_fmto = PIX_FMT_GRAY8;
i_sws_flags = SWS_POINT;
}
}
- if( p_fmti->i_chroma == VLC_FOURCC( 'Y', 'U', 'V', 'A' ) )
+ if( p_fmti->i_chroma == VLC_CODEC_YUVA )
{
i_fmti = PIX_FMT_YUV444P;
b_has_ai = true;
}
- else if( p_fmti->i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'A' ) )
+ else if( p_fmti->i_chroma == VLC_CODEC_RGBA )
{
i_fmti = PIX_FMT_BGR32;
b_has_ai = true;
}
- if( p_fmto->i_chroma == VLC_FOURCC( 'Y', 'U', 'V', 'A' ) )
+ if( p_fmto->i_chroma == VLC_CODEC_YUVA )
{
i_fmto = PIX_FMT_YUV444P;
b_has_ao = true;
}
- else if( p_fmto->i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'A' ) )
+ else if( p_fmto->i_chroma == VLC_CODEC_RGBA )
{
i_fmto = PIX_FMT_BGR32;
b_has_ao = true;
}
+ /* FIXME TODO removed when ffmpeg is fixed
+ * Without SWS_ACCURATE_RND the quality is really bad for some conversions */
+ switch( i_fmto )
+ {
+ case PIX_FMT_ARGB:
+ case PIX_FMT_RGBA:
+ case PIX_FMT_ABGR:
+ i_sws_flags |= SWS_ACCURATE_RND;
+ break;
+ }
+
if( p_cfg )
{
p_cfg->i_fmti = i_fmti;
}
if( p_sys->ctxA )
{
- p_sys->p_src_a = picture_New( VLC_FOURCC( 'G', 'R', 'E', 'Y' ), i_fmti_width, p_fmti->i_height, 0 );
- p_sys->p_dst_a = picture_New( VLC_FOURCC( 'G', 'R', 'E', 'Y' ), i_fmto_width, p_fmto->i_height, 0 );
+ p_sys->p_src_a = picture_New( VLC_CODEC_GREY, i_fmti_width, p_fmti->i_height, 0 );
+ p_sys->p_dst_a = picture_New( VLC_CODEC_GREY, i_fmto_width, p_fmto->i_height, 0 );
}
if( p_sys->i_extend_factor != 1 )
{
uint8_t *dst[3]; int dst_stride[3];
GetPixels( src, src_stride, p_src, i_plane_start, i_plane_count );
- if( p_filter->fmt_in.video.i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'P' ) )
+ if( p_filter->fmt_in.video.i_chroma == VLC_CODEC_RGBP )
{
memset( palette, 0, sizeof(palette) );
if( p_filter->fmt_in.video.p_palette )
if( p_sys->ctxA )
{
/* We extract the A plane to rescale it, and then we reinject it. */
- if( p_fmti->i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'A' ) )
+ if( p_fmti->i_chroma == VLC_CODEC_RGBA )
ExtractA( p_sys->p_src_a, p_src, p_fmti->i_width * p_sys->i_extend_factor, p_fmti->i_height );
else
plane_CopyPixels( p_sys->p_src_a->p, p_src->p+A_PLANE );
Convert( p_filter, p_sys->ctxA, p_sys->p_dst_a, p_sys->p_src_a, p_fmti->i_height, 0, 1 );
- if( p_fmto->i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'A' ) )
+ if( p_fmto->i_chroma == VLC_CODEC_RGBA )
InjectA( p_dst, p_sys->p_dst_a, p_fmto->i_width * p_sys->i_extend_factor, p_fmto->i_height );
else
plane_CopyPixels( p_dst->p+A_PLANE, p_sys->p_dst_a->p );
else if( p_sys->b_add_a )
{
/* We inject a complete opaque alpha plane */
- if( p_fmto->i_chroma == VLC_FOURCC( 'R', 'G', 'B', 'A' ) )
+ if( p_fmto->i_chroma == VLC_CODEC_RGBA )
FillA( &p_dst->p[0], OFFSET_A );
else
FillA( &p_dst->p[A_PLANE], 0 );