[Ffmpeg-devel] [RFC, PATCH] import libswscale
Michael Niedermayer
michaelni
Wed Mar 22 10:31:02 CET 2006
Hi
On Wed, Mar 22, 2006 at 10:10:55AM +0100, Luca Abeni wrote:
> Hi Michael,
>
> first of all, thanks for the feedback.
>
> On Tue, 2006-03-21 at 20:40 +0100, Michael Niedermayer wrote:
> [...]
> > > +/* Choose one of the following:
> > > + SWS_FAST_BILINEAR
> > > + SWS_BILINEAR
> > > + SWS_BICUBIC
> > > + SWS_X
> > > + SWS_POINT
> > > + SWS_AREA
> > > + SWS_BICUBLIN
> > > + SWS_GAUSS
> > > + SWS_SINC
> > > + SWS_LANCZOS
> > > + SWS_SPLINE
> > > +*/
> > > +int sws_flags = SWS_BICUBIC;
> >
> > uhm, globals ...
> I was not sure about how to make the flags configurable, so I used this
> global sws_flags variable. I agree that this is bad, and I'll address
> this problem in the next version of the patch.
>
> Is it ok to define an extended version of img_resample_init() (accepting
> "flags" as a parameter? If yes, then the SWS_* constants mentioned above
> should be moved from swscale.h to libavcodec.h. Is this acceptable?
hmm, IMHO swscale.h could be installed along with avcodec.h
iam also starting to tend more toward using the swscale interface then
the img_* interface from ffmpeg.c, ...
[...]
>
> #define FAST_BGR2YV12 // use 7 bit coeffs instead of 15bit
>
> diff -urp /home/niagara/SwS/main/postproc/rgb2rgb.h /home/niagara/SwS/internal/libswscale/rgb2rgb.h
> --- /home/niagara/SwS/main/postproc/rgb2rgb.h 2005-10-12 14:11:27.000000000 +0200
> +++ /home/niagara/SwS/internal/libswscale/rgb2rgb.h 2006-03-21 10:16:53.000000000 +0100
> @@ -132,11 +132,11 @@ static void yuv2rgb(uint8_t * image, uin
> uint8_t * pu, uint8_t * pv,
> unsigned h_size, unsigned v_size,
> int rgb_stride, int y_stride, int uv_stride){
> -printf("broken, this should use the swscaler\n");
> + av_log(NULL, AV_LOG_ERROR, "broken, this should use the swscaler\n");
> }
>
> static void yuv2rgb_init (unsigned bpp, int mode){
> -printf("broken, this should use the swscaler\n");
> + av_log(NULL, AV_LOG_ERROR, "broken, this should use the swscaler\n");
> }
why not simply remove yuv2rgb_init() and yuv2rgb() ...
[...]
> diff -urp /home/niagara/SwS/main/postproc/swscale_internal.h /home/niagara/SwS/internal/libswscale/swscale_internal.h
> --- /home/niagara/SwS/main/postproc/swscale_internal.h 2006-02-11 15:16:10.000000000 +0100
> +++ /home/niagara/SwS/internal/libswscale/swscale_internal.h 2006-03-21 10:16:53.000000000 +0100
> @@ -29,14 +29,12 @@
> #define AVV(x...) {x}
> #endif
>
> -#include "mp_msg.h"
> -
> -#define MSG_WARN(args...) mp_msg(MSGT_SWS,MSGL_WARN, ##args )
> -#define MSG_FATAL(args...) mp_msg(MSGT_SWS,MSGL_FATAL, ##args )
> -#define MSG_ERR(args...) mp_msg(MSGT_SWS,MSGL_ERR, ##args )
> -#define MSG_V(args...) mp_msg(MSGT_SWS,MSGL_V, ##args )
> -#define MSG_DBG2(args...) mp_msg(MSGT_SWS,MSGL_DBG2, ##args )
> -#define MSG_INFO(args...) mp_msg(MSGT_SWS,MSGL_INFO, ##args )
> +#define MSG_WARN(args...) av_log(NULL, AV_LOG_DEBUG, ##args )
> +#define MSG_FATAL(args...) av_log(NULL, AV_LOG_ERROR, ##args )
> +#define MSG_ERR(args...) av_log(NULL, AV_LOG_ERROR, ##args )
> +#define MSG_V(args...) av_log(NULL, AV_LOG_INFO, ##args )
> +#define MSG_DBG2(args...) av_log(NULL, AV_LOG_DEBUG, ##args )
> +#define MSG_INFO(args...) av_log(NULL, AV_LOG_INFO, ##args )
we also should change NULL to the sws context at some point in the future
[...]
--
Michael
More information about the ffmpeg-devel
mailing list