/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_vout.h>
#include "vlc_filter.h"
* Module descriptor
*****************************************************************************/
vlc_module_begin();
- set_description( _("Video scaling filter") );
+ set_description( N_("Video scaling filter") );
set_capability( "video filter2", 10000 );
// set_category( CAT_VIDEO );
// set_subcategory( SUBCAT_VIDEO_VFILTER2 );
uint8_t *p_dstendline = p_dst + i_dst_visible_pitch;
const uint8_t *p_dstend = p_dst + i_dst_visible_lines*i_dst_pitch;
- int l = 1<<(SHIFT_SIZE-1);
+ const int i_shift_height = i_dst_height / i_src_height;
+ const int i_shift_width = i_dst_width / i_src_width;
+
+ int l = 1<<(SHIFT_SIZE-i_shift_height);
for( ; p_dst < p_dstend;
p_dst += i_dst_hidden_pitch,
p_dstendline += i_dst_pitch, l += i_height_coef )
{
- int k = 1<<(SHIFT_SIZE-1);
+ int k = 1<<(SHIFT_SIZE-i_shift_width);
uint8_t *p_srcl = p_src
+ (__MIN( i_src_height_1, l >> SHIFT_SIZE )*i_src_pitch);
uint32_t *p_dstendline = p_dst + (i_dst_visible_pitch>>2);
const uint32_t *p_dstend = p_dst + i_dst_visible_lines*(i_dst_pitch>>2);
- int l = 1<<(SHIFT_SIZE-1);
+ const int i_shift_height = i_dst_height / i_src_height;
+ const int i_shift_width = i_dst_width / i_src_width;
+
+ int l = 1<<(SHIFT_SIZE-i_shift_height);
for( ; p_dst < p_dstend;
p_dst += (i_dst_hidden_pitch>>2),
p_dstendline += (i_dst_pitch>>2),
l += i_height_coef )
{
- int k = 1<<(SHIFT_SIZE-1);
+ int k = 1<<(SHIFT_SIZE-i_shift_width);
uint32_t *p_srcl = p_src
+ (__MIN( i_src_height_1, l >> SHIFT_SIZE )*(i_src_pitch>>2));
for( ; p_dst < p_dstendline; p_dst++, k += i_width_coef )
p_pic_dst->b_progressive = p_pic->b_progressive;
p_pic_dst->b_top_field_first = p_pic->b_top_field_first;
- p_pic->pf_release( p_pic );
+ if( p_pic->pf_release )
+ p_pic->pf_release( p_pic );
return p_pic_dst;
}