X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fimgresample.c;h=8174d38e0149d6ef9273b7a976c6068c786cb888;hb=255eccab6e75acc16db788f2ed33da53ee018928;hp=82a1d958b8bb7780f0f0a6e2b19f72357aff933f;hpb=9c5d7c568b882f78f1b5c84a3b8e7c44a527054d;p=ffmpeg diff --git a/libavcodec/imgresample.c b/libavcodec/imgresample.c index 82a1d958b8b..8174d38e014 100644 --- a/libavcodec/imgresample.c +++ b/libavcodec/imgresample.c @@ -28,10 +28,6 @@ #include "swscale.h" #include "dsputil.h" -#ifdef USE_FASTMEMCPY -#include "libvo/fastmemcpy.h" -#endif - #define NB_COMPONENTS 3 #define PHASE_BITS 4 @@ -171,7 +167,7 @@ static void v_resample(uint8_t *dst, int dst_width, const uint8_t *src, src_pos += src_incr;\ } -#define DUMP(reg) movq_r2m(reg, tmp); printf(#reg "=%016Lx\n", tmp.uq); +#define DUMP(reg) movq_r2m(reg, tmp); printf(#reg "=%016"PRIx64"\n", tmp.uq); /* XXX: do four pixels at a time */ static void h_resample_fast4_mmx(uint8_t *dst, int dst_width, @@ -282,7 +278,7 @@ static void v_resample4_mmx(uint8_t *dst, int dst_width, const uint8_t *src, } emms(); } -#endif +#endif /* HAVE_MMX */ #ifdef HAVE_ALTIVEC typedef union { @@ -409,7 +405,7 @@ void v_resample16_altivec(uint8_t *dst, int dst_width, const uint8_t *src, dst_width--; } } -#endif +#endif /* HAVE_ALTIVEC */ /* slow version to handle limit cases. Does not need optimisation */ static void h_resample_slow(uint8_t *dst, int dst_width, @@ -672,6 +668,8 @@ struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, void sws_freeContext(struct SwsContext *ctx) { + if (!ctx) + return; if ((ctx->resampling_ctx->iwidth != ctx->resampling_ctx->owidth) || (ctx->resampling_ctx->iheight != ctx->resampling_ctx->oheight)) { img_resample_close(ctx->resampling_ctx); @@ -800,7 +798,7 @@ int sws_scale(struct SwsContext *ctx, uint8_t* src[], int srcStride[], goto the_end; } } else if (resampled_picture != &dst_pict) { - img_copy(&dst_pict, resampled_picture, current_pix_fmt, + av_picture_copy(&dst_pict, resampled_picture, current_pix_fmt, ctx->resampling_ctx->owidth, ctx->resampling_ctx->oheight); } @@ -813,6 +811,7 @@ the_end: #ifdef TEST #include +#undef exit /* input */ #define XSIZE 256 @@ -940,8 +939,8 @@ int main(int argc, char **argv) exit(1); } av_log(NULL, AV_LOG_INFO, "MMX OK\n"); -#endif +#endif /* HAVE_MMX */ return 0; } -#endif +#endif /* TEST */