[vlc-devel] [PATCH] Cleanliness, dead code and warnings
Laurent Aimar
fenrir at elivagar.org
Sun Jan 9 22:13:26 CET 2011
On Sun, Jan 09, 2011 at 07:04:53PM +0100, Guillaume Poussel wrote:
> No problem, two patches are now attached.
> From 87c6409cb39a9c3ef9e69b2dd4f118dbfe0c2500 Mon Sep 17 00:00:00 2001
> From: Guillaume Poussel <gpoussel at gmail.com>
> Date: Sun, 9 Jan 2011 18:38:48 +0100
> Subject: [PATCH 3/4] Remove few warnings
>
> diff --git a/modules/demux/xiph.h b/modules/demux/xiph.h
> index 9c92906..124e73c 100644
> --- a/modules/demux/xiph.h
> +++ b/modules/demux/xiph.h
> @@ -48,7 +48,7 @@ static inline int xiph_SplitHeaders(unsigned packet_size[], void *packet[], unsi
> }
> size += packet_size[i];
> }
> - if (end - current < size)
> + if (end < current + size)
> return VLC_EGENERIC;
It could create an invalid test (if current + size goes outside a
valid memory range).
> diff --git a/modules/stream_out/rtpfmt.c b/modules/stream_out/rtpfmt.c
> index 68dea4b..69c08e4 100644
> --- a/modules/stream_out/rtpfmt.c
> +++ b/modules/stream_out/rtpfmt.c
> @@ -467,7 +467,7 @@ int rtp_get_fmt( vlc_object_t *obj, es_format_t *p_fmt, const char *mux,
> if( p_fmt->i_extra > 0 )
> {
> rtp_fmt->fmtp = NULL;
> - uint8_t pixel_fmt, c1, c2;
> + uint8_t pixel_fmt, c1 = 0, c2 = 0;
Useless initialization. The case where they are used is not possible.
> From cb82486ee41e5a12a63b20608242221245919a30 Mon Sep 17 00:00:00 2001
> From: Guillaume Poussel <gpoussel at gmail.com>
> Date: Sun, 9 Jan 2011 18:46:23 +0100
> Subject: [PATCH 4/4] Remove lot of dead code
>
> ---
> modules/control/http/macro.c | 20 -
> modules/control/http/mvar.c | 41 ---
> modules/control/netsync.c | 15 -
> modules/mux/avi.c | 12 -
> modules/mux/mpeg/ts.c | 96 -----
> modules/packetizer/dirac.c | 2 -
> modules/packetizer/mpeg4audio.c | 52 ---
> modules/packetizer/mpeg4video.c | 16 -
> modules/packetizer/mpegvideo.c | 21 --
> modules/video_filter/blend.c | 6 -
> .../libswscale_nokia770/arm_jit_swscale.c | 14 -
> modules/video_filter/osdmenu.c | 45 ---
> modules/video_filter/panoramix.c | 39 --
> modules/video_filter/swscale.c | 6 -
> modules/video_filter/transform.c | 376 --------------------
> modules/video_filter/yadif.h | 7 -
> 16 files changed, 0 insertions(+), 768 deletions(-)
>
> diff --git a/modules/control/netsync.c b/modules/control/netsync.c
> index e4f7106..f6d0940 100644
> --- a/modules/control/netsync.c
> +++ b/modules/control/netsync.c
> @@ -199,15 +199,6 @@ static void *Master(void *handle)
> /* Reply to the sender */
> sendto(sys->fd, data, sizeof(data), 0,
> (struct sockaddr *)&from, struct_size);
> -#if 0
> - /* not sure we need the client information to sync,
> - since we are the master anyway */
> - mtime_t client_system = ntoh64(data[0]);
> - msg_Dbg(intf, "Master clockref: %"PRId64" -> %"PRId64", from %s "
> - "(date: %"PRId64")", client_system, master_system,
> - (from.ss_family == AF_INET) ? inet_ntoa(((struct sockaddr_in *)&from)->sin_addr)
> - : "non-IPv4", /*date*/ 0);
> -#endif
> }
> }
>
> @@ -255,12 +246,6 @@ static void *Slave(void *handle)
> const mtime_t diff_system = client_system - master_system - diff_date;
> if (diff_system != 0) {
> input_ModifyPcrSystem(sys->input, true, master_system - diff_date);
> -#if 0
> - msg_Dbg(intf, "Slave clockref: %"PRId64" -> %"PRId64" -> %"PRId64","
> - " clock diff: %"PRId64", diff: %"PRId64"",
> - system, master_system, client_system,
> - diff_system, diff_date);
> -#endif
> }
> }
> vlc_restorecancel(canc);
They are very usefull to debug, and so should be kept.
> diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c
> index 7a6f415..db8907e 100644
> --- a/modules/mux/mpeg/ts.c
> +++ b/modules/mux/mpeg/ts.c
> @@ -1951,15 +1951,6 @@ static void TSDate( sout_mux_t *p_mux, sout_buffer_chain_t *p_chain_ts,
> i_pcr_dts + p_sys->i_shaping_delay * 3 / 2 - mdate(),
> i_bitrate, i_packet_count, i_pcr_length);
> }
> -#if 0
> - else
> - {
> - msg_Dbg( p_mux, "starting at %"PRId64
> - " (%d bi/s for %d packets in %"PRId64" us)",
> - i_pcr_dts + p_sys->i_shaping_delay * 3 / 2 - mdate(),
> - i_bitrate, i_packet_count, i_pcr_length);
> - }
> -#endif
> }
> else
> {
> @@ -2133,93 +2124,6 @@ static void TSSetPCR( block_t *p_ts, mtime_t i_dts )
> p_ts->p_buffer[10]|= ( i_pcr << 7 )&0x80;
> }
Probably the same.
> diff --git a/modules/packetizer/mpeg4audio.c b/modules/packetizer/mpeg4audio.c
> index 3e4561c..8835082 100644
> --- a/modules/packetizer/mpeg4audio.c
> +++ b/modules/packetizer/mpeg4audio.c
> @@ -513,26 +487,6 @@ static int Mpeg4ReadAudioSamplerate( bs_t *s )
>
> static int Mpeg4ReadAudioSpecificInfo( mpeg4_cfg_t *p_cfg, int *pi_extra, uint8_t *p_extra, bs_t *s, int i_max_size )
> {
> -#if 0
> - static const char *ppsz_otype[] = {
> - "NULL",
> - "AAC Main", "AAC LC", "AAC SSR", "AAC LTP", "SBR", "AAC Scalable",
> - "TwinVQ",
> - "CELP", "HVXC",
> - "Reserved", "Reserved",
> - "TTSI",
> - "Main Synthetic", "Wavetables Synthesis", "General MIDI",
> - "Algorithmic Synthesis and Audio FX",
> - "ER AAC LC",
> - "Reserved",
> - "ER AAC LTP", "ER AAC Scalable", "ER TwinVQ", "ER BSAC", "ER AAC LD",
> - "ER CELP", "ER HVXC", "ER HILN", "ER Parametric",
> - "SSC",
> - "PS", "Reserved", "Escape",
> - "Layer 1", "Layer 2", "Layer 3",
> - "DST",
> - };
> -#endif
Idem.
> const int i_pos_start = bs_pos( s );
> bs_t s_sav = *s;
> int i_bits;
> @@ -1215,12 +1169,6 @@ static void SetupOutput( decoder_t *p_dec, block_t *p_block )
> p_dec->fmt_out.audio.i_bytes_per_frame = p_sys->i_frame_size;
> p_dec->fmt_out.audio.i_frame_length = p_sys->i_frame_length;
>
> -#if 0
> - p_dec->fmt_out.audio.i_original_channels = p_sys->i_channels_conf;
> - p_dec->fmt_out.audio.i_physical_channels =
> - p_sys->i_channels_conf & AOUT_CHAN_PHYSMASK;
> -#endif
Dunno about this one.
> diff --git a/modules/packetizer/mpeg4video.c b/modules/packetizer/mpeg4video.c
> index 84946a5..5ce4326 100644
> --- a/modules/packetizer/mpeg4video.c
> +++ b/modules/packetizer/mpeg4video.c
> @@ -480,12 +470,6 @@ static int ParseVOP( decoder_t *p_dec, block_t *p_vop )
> (i_modulo_time_base * p_dec->p_sys->i_fps_num);
> }
>
> -#if 0
> - msg_Err( p_dec, "interp pts/dts (%lli,%lli), pts/dts (%lli,%lli)",
> - p_sys->i_interpolated_pts, p_sys->i_interpolated_dts,
> - p_vop->i_pts, p_vop->i_dts );
> -#endif
> -
> if( p_dec->p_sys->i_fps_num < 5 && /* Work-around buggy streams */
> p_dec->fmt_in.video.i_frame_rate > 0 &&
> p_dec->fmt_in.video.i_frame_rate_base > 0 )
For debugging.
> diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c
> index eb93133..d7bbabf 100644
> --- a/modules/packetizer/mpegvideo.c
> +++ b/modules/packetizer/mpegvideo.c
> @@ -474,11 +474,6 @@ static block_t *ParseMPEGBlock( decoder_t *p_dec, block_t *p_frag )
>
> p_pic->i_length = p_sys->i_interpolated_dts - p_pic->i_dts;
>
> -#if 0
> - msg_Dbg( p_dec, "pic: type=%d dts=%"PRId64" pts-dts=%"PRId64,
> - p_sys->i_picture_type, p_pic->i_dts, p_pic->i_pts - p_pic->i_dts);
> -#endif
> -
> /* Reset context */
> p_sys->p_frame = NULL;
> p_sys->pp_last = &p_sys->p_frame;
Idem.
> @@ -582,14 +577,6 @@ static block_t *ParseMPEGBlock( decoder_t *p_dec, block_t *p_frag )
> /* Extension start code */
> if( i_type == 0x01 )
> {
> -#if 0
> - static const int mpeg2_aspect[16][2] =
> - {
> - {0,1}, {1,1}, {4,3}, {16,9}, {221,100},
> - {0,1}, {0,1}, {0,1}, {0,1}, {0,1}, {0,1}, {0,1}, {0,1}, {0,1},
> - {0,1}, {0,1}
> - };
> -#endif
>
> /* sequence extension */
> if( p_sys->p_ext) block_Release( p_sys->p_ext );
> @@ -609,14 +596,6 @@ static block_t *ParseMPEGBlock( decoder_t *p_dec, block_t *p_frag )
> * a specific aspect ratio, which she hasn't. Thus in case
> * of aspect ratio change, we're screwed. --Meuuh
> */
> -#if 0
> - p_dec->fmt_out.video.i_sar_num =
> - mpeg2_aspect[p_sys->i_aspect_ratio_info][0] *
> - p_dec->fmt_out.video.i_height;
> - p_dec->fmt_out.video.i_sar_den =
> - mpeg2_aspect[p_sys->i_aspect_ratio_info][1] *
> - p_dec->fmt_out.video.i_width;
> -#endif
>
> }
> else if( i_type == 0x08 )
I prefer to keep it. One day, this code will be useful again (when
there is a way to know from where comes the AR).
> diff --git a/modules/video_filter/blend.c b/modules/video_filter/blend.c
> index 41cb031..96a7dd5 100644
> --- a/modules/video_filter/blend.c
> +++ b/modules/video_filter/blend.c
> @@ -233,12 +233,6 @@ static void Blend( filter_t *p_filter,
> video_format_FixRgb( &p_filter->fmt_out.video );
> video_format_FixRgb( &p_filter->fmt_in.video );
>
> -#if 0
> - msg_Dbg( p_filter, "chroma: %4.4s -> %4.4s\n",
> - (char *)&p_filter->fmt_in.video.i_chroma,
> - (char *)&p_filter->fmt_out.video.i_chroma );
> -#endif
> -
>
> p_blend_cfg[p_filter->p_sys->i_blendcfg].pf_blend( p_filter, p_dst, p_src,
> i_x_offset, i_y_offset,
For debugging.
> diff --git a/modules/video_filter/libswscale_nokia770/arm_jit_swscale.c b/modules/video_filter/libswscale_nokia770/arm_jit_swscale.c
> index ef2b3d9..87c982a 100644
> --- a/modules/video_filter/libswscale_nokia770/arm_jit_swscale.c
> +++ b/modules/video_filter/libswscale_nokia770/arm_jit_swscale.c
> @@ -80,20 +80,6 @@ static inline int get_pix(int quality, int orig_w, int dest_w, int x, int *p1, i
> return INTERPOLATE_COPY_FIRST;
> }
> dist = offs - ((double)pix1 + 0.5);
> -#if 0
> - if (quality >= 3) {
> - if (dist > 0.125 && dist < 0.375) {
> - *p1 = pix1;
> - *p2 = pix2;
> - return INTERPOLATE_AVERAGE_3_1;
> - }
> - if (dist > 0.625 && dist < 0.875) {
> - *p1 = pix1;
> - *p2 = pix2;
> - return INTERPOLATE_AVERAGE_1_3;
> - }
> - }
> -#endif
> if (quality >= 2) {
> if (dist > 0.25 && dist < 0.75) {
> *p1 = pix1;
Dunno.
> diff --git a/modules/video_filter/swscale.c b/modules/video_filter/swscale.c
> index b60c5f6..8165c08 100644
> --- a/modules/video_filter/swscale.c
> +++ b/modules/video_filter/swscale.c
> @@ -425,12 +425,6 @@ static int Init( filter_t *p_filter )
> p_sys->b_swap_uvo = cfg.b_swap_uvo;
>
> video_format_ScaleCropAr( p_fmto, p_fmti );
> -#if 0
> - msg_Dbg( p_filter, "%ix%i chroma: %4.4s -> %ix%i chroma: %4.4s extend by %d",
> - p_fmti->i_width, p_fmti->i_height, (char *)&p_fmti->i_chroma,
> - p_fmto->i_width, p_fmto->i_height, (char *)&p_fmto->i_chroma,
> - p_sys->i_extend_factor );
> -#endif
> return VLC_SUCCESS;
> }
> static void Clean( filter_t *p_filter )
For debugging.
> diff --git a/modules/video_filter/transform.c b/modules/video_filter/transform.c
> index 72dcd70..7f051af 100644
> --- a/modules/video_filter/transform.c
> +++ b/modules/video_filter/transform.c
> @@ -248,379 +248,3 @@ static void Close(vlc_object_t *object)
>
> free(sys);
> }
> -
> -#if 0
> -/*****************************************************************************
> - * Init: initialize Transform video thread output method
> - *****************************************************************************/
> -static int Init( vout_thread_t *p_vout )
> -{
> - video_format_t fmt;
> -
> - I_OUTPUTPICTURES = 0;
> - memset( &fmt, 0, sizeof(video_format_t ) );
> -
> - /* Initialize the output structure */
> - p_vout->output.i_chroma = p_vout->render.i_chroma;
> - p_vout->output.i_width = p_vout->render.i_width;
> - p_vout->output.i_height = p_vout->render.i_height;
> - p_vout->output.i_aspect = p_vout->render.i_aspect;
> - p_vout->fmt_out = p_vout->fmt_in;
> - fmt = p_vout->fmt_out;
> -
> - /* Try to open the real video output */
> - msg_Dbg( p_vout, "spawning the real video output" );
> -
> - if( p_vout->p_sys->b_rotation )
> - {
> - fmt.i_width = p_vout->fmt_out.i_height;
> - fmt.i_visible_width = p_vout->fmt_out.i_visible_height;
> - fmt.i_x_offset = p_vout->fmt_out.i_y_offset;
> -
> - fmt.i_height = p_vout->fmt_out.i_width;
> - fmt.i_visible_height = p_vout->fmt_out.i_visible_width;
> - fmt.i_y_offset = p_vout->fmt_out.i_x_offset;
> -
> - fmt.i_sar_num = p_vout->fmt_out.i_sar_den;
> - fmt.i_sar_den = p_vout->fmt_out.i_sar_num;
> - }
> -
> - p_vout->p_sys->p_vout = vout_Create( p_vout, &fmt );
> -
> - /* Everything failed */
> - if( p_vout->p_sys->p_vout == NULL )
> - {
> - msg_Err( p_vout, "cannot open vout, aborting" );
> - return VLC_EGENERIC;
> - }
> -
> - vout_filter_AllocateDirectBuffers( p_vout, VOUT_MAX_PICTURES );
> -
> - vout_filter_AddChild( p_vout, p_vout->p_sys->p_vout, MouseEvent );
> -
> - return VLC_SUCCESS;
> -}
Ok.
> -static void FilterI422( vout_thread_t *p_vout,
> - const picture_t *p_pic, picture_t *p_outpic )
> -{
> - int i_index;
> - switch( p_vout->p_sys->i_mode )
> - {
> - case TRANSFORM_MODE_180:
> - case TRANSFORM_MODE_HFLIP:
> - case TRANSFORM_MODE_VFLIP:
> - /* Fall back on the default implementation */
> - FilterPlanar( p_vout, p_pic, p_outpic );
> - return;
> -
> - case TRANSFORM_MODE_90:
> - for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
> - {
> - int i_pitch = p_pic->p[i_index].i_pitch;
> -
> - uint8_t *p_in = p_pic->p[i_index].p_pixels;
> -
> - uint8_t *p_out = p_outpic->p[i_index].p_pixels;
> - uint8_t *p_out_end = p_out +
> - p_outpic->p[i_index].i_visible_lines *
> - p_outpic->p[i_index].i_pitch;
> -
> - if( i_index == 0 )
> - {
> - for( ; p_out < p_out_end ; )
> - {
> - uint8_t *p_line_end;
> -
> - p_out_end -= p_outpic->p[i_index].i_pitch
> - - p_outpic->p[i_index].i_visible_pitch;
> - p_line_end = p_in + p_pic->p[i_index].i_visible_lines *
> - i_pitch;
> -
> - for( ; p_in < p_line_end ; )
> - {
> - p_line_end -= i_pitch;
> - *(--p_out_end) = *p_line_end;
> - }
> -
> - p_in++;
> - }
> - }
> - else /* i_index == 1 or 2 */
> - {
> - for( ; p_out < p_out_end ; )
> - {
> - uint8_t *p_line_end, *p_out_end2;
> -
> - p_out_end -= p_outpic->p[i_index].i_pitch
> - - p_outpic->p[i_index].i_visible_pitch;
> - p_out_end2 = p_out_end - p_outpic->p[i_index].i_pitch;
> - p_line_end = p_in + p_pic->p[i_index].i_visible_lines *
> - i_pitch;
> -
> - for( ; p_in < p_line_end ; )
> - {
> - uint8_t p1, p2;
> -
> - p_line_end -= i_pitch;
> - p1 = *p_line_end;
> - p_line_end -= i_pitch;
> - p2 = *p_line_end;
> -
> - /* Trick for (x+y)/2 without overflow, based on
> - * x + y == (x ^ y) + 2 * (x & y) */
> - *(--p_out_end) = (p1 & p2) + ((p1 ^ p2) / 2);
> - *(--p_out_end2) = (p1 & p2) + ((p1 ^ p2) / 2);
> - }
> -
> - p_out_end = p_out_end2;
> - p_in++;
> - }
> - }
> - }
> - break;
> -
> - case TRANSFORM_MODE_270:
> - for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
> - {
> - int i_pitch = p_pic->p[i_index].i_pitch;
> -
> - uint8_t *p_in = p_pic->p[i_index].p_pixels;
> -
> - uint8_t *p_out = p_outpic->p[i_index].p_pixels;
> - uint8_t *p_out_end = p_out +
> - p_outpic->p[i_index].i_visible_lines *
> - p_outpic->p[i_index].i_pitch;
> -
> - if( i_index == 0 )
> - {
> - for( ; p_out < p_out_end ; )
> - {
> - uint8_t *p_in_end;
> -
> - p_in_end = p_in + p_pic->p[i_index].i_visible_lines *
> - i_pitch;
> -
> - for( ; p_in < p_in_end ; )
> - {
> - p_in_end -= i_pitch;
> - *p_out++ = *p_in_end;
> - }
> -
> - p_out += p_outpic->p[i_index].i_pitch
> - - p_outpic->p[i_index].i_visible_pitch;
> - p_in++;
> - }
> - }
> - else /* i_index == 1 or 2 */
> - {
> - for( ; p_out < p_out_end ; )
> - {
> - uint8_t *p_in_end, *p_out2;
> -
> - p_in_end = p_in + p_pic->p[i_index].i_visible_lines *
> - i_pitch;
> - p_out2 = p_out + p_outpic->p[i_index].i_pitch;
> -
> - for( ; p_in < p_in_end ; )
> - {
> - uint8_t p1, p2;
> -
> - p_in_end -= i_pitch;
> - p1 = *p_in_end;
> - p_in_end -= i_pitch;
> - p2 = *p_in_end;
> -
> - /* Trick for (x+y)/2 without overflow, based on
> - * x + y == (x ^ y) + 2 * (x & y) */
> - *p_out++ = (p1 & p2) + ((p1 ^ p2) / 2);
> - *p_out2++ = (p1 & p2) + ((p1 ^ p2) / 2);
> - }
> -
> - p_out2 += p_outpic->p[i_index].i_pitch
> - - p_outpic->p[i_index].i_visible_pitch;
> - p_out = p_out2;
> - p_in++;
> - }
> - }
> - }
> - break;
> -
> - default:
> - break;
> - }
> -}
> -
> -static void FilterYUYV( vout_thread_t *p_vout,
> - const picture_t *p_pic, picture_t *p_outpic )
> -{
> - int i_index;
> - int i_y_offset, i_u_offset, i_v_offset;
> - if( GetPackedYuvOffsets( p_pic->format.i_chroma, &i_y_offset,
> - &i_u_offset, &i_v_offset ) != VLC_SUCCESS )
> - return;
> -
> - switch( p_vout->p_sys->i_mode )
> - {
> - case TRANSFORM_MODE_VFLIP:
> - /* Fall back on the default implementation */
> - FilterPlanar( p_vout, p_pic, p_outpic );
> - return;
> -
> - case TRANSFORM_MODE_90:
> - for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
> - {
> - int i_pitch = p_pic->p[i_index].i_pitch;
> -
> - uint8_t *p_in = p_pic->p[i_index].p_pixels;
> -
> - uint8_t *p_out = p_outpic->p[i_index].p_pixels;
> - uint8_t *p_out_end = p_out +
> - p_outpic->p[i_index].i_visible_lines *
> - p_outpic->p[i_index].i_pitch;
> -
> - int i_offset = i_u_offset;
> - int i_offset2 = i_v_offset;
> - for( ; p_out < p_out_end ; )
> - {
> - uint8_t *p_line_end;
> -
> - p_out_end -= p_outpic->p[i_index].i_pitch
> - - p_outpic->p[i_index].i_visible_pitch;
> - p_line_end = p_in + p_pic->p[i_index].i_visible_lines *
> - i_pitch;
> -
> - for( ; p_in < p_line_end ; )
> - {
> - p_line_end -= i_pitch;
> - p_out_end -= 4;
> - p_out_end[i_y_offset+2] = p_line_end[i_y_offset];
> - p_out_end[i_u_offset] = p_line_end[i_offset];
> - p_line_end -= i_pitch;
> - p_out_end[i_y_offset] = p_line_end[i_y_offset];
> - p_out_end[i_v_offset] = p_line_end[i_offset2];
> - }
> -
> - p_in += 2;
> -
> - {
> - int a = i_offset;
> - i_offset = i_offset2;
> - i_offset2 = a;
> - }
> - }
> - }
> - break;
> -
> - case TRANSFORM_MODE_180:
> - for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
> - {
> - uint8_t *p_in = p_pic->p[i_index].p_pixels;
> - uint8_t *p_in_end = p_in + p_pic->p[i_index].i_visible_lines
> - * p_pic->p[i_index].i_pitch;
> -
> - uint8_t *p_out = p_outpic->p[i_index].p_pixels;
> -
> - for( ; p_in < p_in_end ; )
> - {
> - uint8_t *p_line_start = p_in_end
> - - p_pic->p[i_index].i_pitch;
> - p_in_end -= p_pic->p[i_index].i_pitch
> - - p_pic->p[i_index].i_visible_pitch;
> -
> - for( ; p_line_start < p_in_end ; )
> - {
> - p_in_end -= 4;
> - p_out[i_y_offset] = p_in_end[i_y_offset+2];
> - p_out[i_u_offset] = p_in_end[i_u_offset];
> - p_out[i_y_offset+2] = p_in_end[i_y_offset];
> - p_out[i_v_offset] = p_in_end[i_v_offset];
> - p_out += 4;
> - }
> -
> - p_out += p_outpic->p[i_index].i_pitch
> - - p_outpic->p[i_index].i_visible_pitch;
> - }
> - }
> - break;
> -
> - case TRANSFORM_MODE_270:
> - for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
> - {
> - int i_pitch = p_pic->p[i_index].i_pitch;
> -
> - uint8_t *p_in = p_pic->p[i_index].p_pixels;
> -
> - uint8_t *p_out = p_outpic->p[i_index].p_pixels;
> - uint8_t *p_out_end = p_out +
> - p_outpic->p[i_index].i_visible_lines *
> - p_outpic->p[i_index].i_pitch;
> -
> - int i_offset = i_u_offset;
> - int i_offset2 = i_v_offset;
> - for( ; p_out < p_out_end ; )
> - {
> - uint8_t *p_in_end;
> -
> - p_in_end = p_in
> - + p_pic->p[i_index].i_visible_lines * i_pitch;
> -
> - for( ; p_in < p_in_end ; )
> - {
> - p_in_end -= i_pitch;
> - p_out[i_y_offset] = p_in_end[i_y_offset];
> - p_out[i_u_offset] = p_in_end[i_offset];
> - p_in_end -= i_pitch;
> - p_out[i_y_offset+2] = p_in_end[i_y_offset];
> - p_out[i_v_offset] = p_in_end[i_offset2];
> - p_out += 4;
> - }
> -
> - p_out += p_outpic->p[i_index].i_pitch
> - - p_outpic->p[i_index].i_visible_pitch;
> - p_in += 2;
> -
> - {
> - int a = i_offset;
> - i_offset = i_offset2;
> - i_offset2 = a;
> - }
> - }
> - }
> - break;
> -
> - case TRANSFORM_MODE_HFLIP:
> - for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
> - {
> - uint8_t *p_in = p_pic->p[i_index].p_pixels;
> - uint8_t *p_in_end = p_in + p_pic->p[i_index].i_visible_lines
> - * p_pic->p[i_index].i_pitch;
> -
> - uint8_t *p_out = p_outpic->p[i_index].p_pixels;
> -
> - for( ; p_in < p_in_end ; )
> - {
> - uint8_t *p_line_end = p_in
> - + p_pic->p[i_index].i_visible_pitch;
> -
> - for( ; p_in < p_line_end ; )
> - {
> - p_line_end -= 4;
> - p_out[i_y_offset] = p_line_end[i_y_offset+2];
> - p_out[i_u_offset] = p_line_end[i_u_offset];
> - p_out[i_y_offset+2] = p_line_end[i_y_offset];
> - p_out[i_v_offset] = p_line_end[i_v_offset];
> - p_out += 4;
> - }
> -
> - p_in += p_pic->p[i_index].i_pitch;
> - p_out += p_outpic->p[i_index].i_pitch
> - - p_outpic->p[i_index].i_visible_pitch;
> - }
> - }
> - break;
> -
> - default:
> - break;
> - }
> -}
> -#endif
Should be kept, as they should be converted to the new way.
> diff --git a/modules/video_filter/yadif.h b/modules/video_filter/yadif.h
> index 2d2a56f..13e9042 100644
> --- a/modules/video_filter/yadif.h
> +++ b/modules/video_filter/yadif.h
> @@ -266,15 +266,8 @@ static void yadif_filter_line_c(struct vf_priv_s *p, uint8_t *dst, uint8_t *prev
> if(p->mode<2){
> int b= (prev2[-2*refs] + next2[-2*refs])>>1;
> int f= (prev2[+2*refs] + next2[+2*refs])>>1;
> -#if 0
> - int a= cur[-3*refs];
> - int g= cur[+3*refs];
> - int max= FFMAX3(d-e, d-c, FFMIN3(FFMAX(b-c,f-e),FFMAX(b-c,b-a),FFMAX(f-g,f-e)) );
> - int min= FFMIN3(d-e, d-c, FFMAX3(FFMIN(b-c,f-e),FFMIN(b-c,b-a),FFMIN(f-g,f-e)) );
> -#else
> int max= FFMAX3(d-e, d-c, FFMIN(b-c, f-e));
> int min= FFMIN3(d-e, d-c, FFMAX(b-c, f-e));
> -#endif
>
> diff= FFMAX3(diff, min, -max);
> }
No. It is an external file and should not be changed to ease maintainance.
Regards,
--
fenrir
More information about the vlc-devel
mailing list