summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-26 18:46:18 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-04-26 18:46:18 +0300
commit9a34ae4fd05226feb5b82573a4283c3cd8586b8a (patch)
tree157e9ea076c46fe37e626704a7b81c6e8b2a6db3 /libmpcodecs
parent8df340271e868252e7398307e126ea12083d426b (diff)
parent91a84df7d0b19ca510a78191233f17c2d7691b95 (diff)
downloadmpv-9a34ae4fd05226feb5b82573a4283c3cd8586b8a.tar.bz2
mpv-9a34ae4fd05226feb5b82573a4283c3cd8586b8a.tar.xz
Merge svn changes up to r31050
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/mp_image.c11
-rw-r--r--libmpcodecs/vd_dmo.c3
-rw-r--r--libmpcodecs/ve_x264.c1
-rw-r--r--libmpcodecs/vf.c3
-rw-r--r--libmpcodecs/vf_noise.c7
-rw-r--r--libmpcodecs/vf_screenshot.c6
-rw-r--r--libmpcodecs/vf_unsharp.c8
7 files changed, 22 insertions, 17 deletions
diff --git a/libmpcodecs/mp_image.c b/libmpcodecs/mp_image.c
index e71821129d..898f5fac96 100644
--- a/libmpcodecs/mp_image.c
+++ b/libmpcodecs/mp_image.c
@@ -30,14 +30,15 @@
#include "libmpcodecs/mp_image.h"
#include "libvo/fastmemcpy.h"
+#include "libavutil/mem.h"
void mp_image_alloc_planes(mp_image_t *mpi) {
// IF09 - allocate space for 4. plane delta info - unused
if (mpi->imgfmt == IMGFMT_IF09) {
- mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8+
+ mpi->planes[0]=av_malloc(mpi->bpp*mpi->width*(mpi->height+2)/8+
mpi->chroma_width*mpi->chroma_height);
} else
- mpi->planes[0]=memalign(64, mpi->bpp*mpi->width*(mpi->height+2)/8);
+ mpi->planes[0]=av_malloc(mpi->bpp*mpi->width*(mpi->height+2)/8);
if (mpi->flags&MP_IMGFLAG_PLANAR) {
int bpp = IMGFMT_IS_YUVP16(mpi->imgfmt)? 2 : 1;
// YV12/I420/YVU9/IF09. feel free to add other planar formats here...
@@ -65,7 +66,7 @@ void mp_image_alloc_planes(mp_image_t *mpi) {
} else {
mpi->stride[0]=mpi->width*mpi->bpp/8;
if (mpi->flags & MP_IMGFLAG_RGB_PALETTE)
- mpi->planes[1] = memalign(64, 1024);
+ mpi->planes[1] = av_malloc(1024);
}
mpi->flags|=MP_IMGFLAG_ALLOCATED;
}
@@ -191,9 +192,9 @@ void free_mp_image(mp_image_t* mpi){
if(!mpi) return;
if(mpi->flags&MP_IMGFLAG_ALLOCATED){
/* becouse we allocate the whole image in once */
- if(mpi->planes[0]) free(mpi->planes[0]);
+ if(mpi->planes[0]) av_free(mpi->planes[0]);
if (mpi->flags & MP_IMGFLAG_RGB_PALETTE)
- free(mpi->planes[1]);
+ av_free(mpi->planes[1]);
}
free(mpi);
}
diff --git a/libmpcodecs/vd_dmo.c b/libmpcodecs/vd_dmo.c
index 9f9c6a7a80..31d9f1e351 100644
--- a/libmpcodecs/vd_dmo.c
+++ b/libmpcodecs/vd_dmo.c
@@ -82,7 +82,7 @@ static int init(sh_video_t *sh){
if (sh->disp_w & 3)
{
ctx->stride = ((sh->disp_w * 3) + 3) & ~3;
- ctx->buffer = memalign(64, ctx->stride * sh->disp_h);
+ ctx->buffer = av_malloc(ctx->stride * sh->disp_h);
}
default:
DMO_VideoDecoder_SetDestFmt(ctx->decoder,out_fmt&255,0); // RGB/BGR
@@ -96,6 +96,7 @@ static int init(sh_video_t *sh){
static void uninit(sh_video_t *sh){
struct context *ctx = sh->context;
DMO_VideoDecoder_Destroy(ctx->decoder);
+ av_free(ctx->buffer);
free(ctx);
sh->context = NULL;
}
diff --git a/libmpcodecs/ve_x264.c b/libmpcodecs/ve_x264.c
index 832d58ac6a..4a84f8dead 100644
--- a/libmpcodecs/ve_x264.c
+++ b/libmpcodecs/ve_x264.c
@@ -152,6 +152,7 @@ static int config(struct vf_instance* vf, int width, int height, int d_width, in
param.i_height = height;
param.i_fps_num = mod->mux->h.dwRate;
param.i_fps_den = mod->mux->h.dwScale;
+ param.b_vfr_input = 0;
param.vui.i_sar_width = d_width*height;
param.vui.i_sar_height = d_height*width;
diff --git a/libmpcodecs/vf.c b/libmpcodecs/vf.c
index 65c2f17a58..0f2dcc75d2 100644
--- a/libmpcodecs/vf.c
+++ b/libmpcodecs/vf.c
@@ -39,6 +39,7 @@
#include "vf.h"
#include "libvo/fastmemcpy.h"
+#include "libavutil/mem.h"
extern const vf_info_t vf_info_vo;
extern const vf_info_t vf_info_rectangle;
@@ -356,7 +357,7 @@ mp_image_t* vf_get_image(vf_instance_t* vf, unsigned int outfmt, int mp_imgtype,
if(mpi->flags&MP_IMGFLAG_ALLOCATED){
if(mpi->width<w2 || mpi->height<h){
// need to re-allocate buffer memory:
- free(mpi->planes[0]);
+ av_free(mpi->planes[0]);
mpi->flags&=~MP_IMGFLAG_ALLOCATED;
mp_msg(MSGT_VFILTER,MSGL_V,"vf.c: have to REALLOCATE buffer memory :(\n");
}
diff --git a/libmpcodecs/vf_noise.c b/libmpcodecs/vf_noise.c
index 9242df8339..59835daf50 100644
--- a/libmpcodecs/vf_noise.c
+++ b/libmpcodecs/vf_noise.c
@@ -36,6 +36,7 @@
#include "mp_image.h"
#include "vf.h"
#include "libvo/fastmemcpy.h"
+#include "libavutil/mem.h"
#define MAX_NOISE 4096
#define MAX_SHIFT 1024
@@ -80,7 +81,7 @@ static int8_t *initNoise(FilterParam *fp){
int uniform= fp->uniform;
int averaged= fp->averaged;
int pattern= fp->pattern;
- int8_t *noise= memalign(16, MAX_NOISE*sizeof(int8_t));
+ int8_t *noise= av_malloc(MAX_NOISE*sizeof(int8_t));
int i, j;
srand(123457);
@@ -369,10 +370,10 @@ static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts){
static void uninit(struct vf_instance* vf){
if(!vf->priv) return;
- if(vf->priv->chromaParam.noise) free(vf->priv->chromaParam.noise);
+ if(vf->priv->chromaParam.noise) av_free(vf->priv->chromaParam.noise);
vf->priv->chromaParam.noise= NULL;
- if(vf->priv->lumaParam.noise) free(vf->priv->lumaParam.noise);
+ if(vf->priv->lumaParam.noise) av_free(vf->priv->lumaParam.noise);
vf->priv->lumaParam.noise= NULL;
free(vf->priv);
diff --git a/libmpcodecs/vf_screenshot.c b/libmpcodecs/vf_screenshot.c
index 7ab25305ef..a2680cc6d1 100644
--- a/libmpcodecs/vf_screenshot.c
+++ b/libmpcodecs/vf_screenshot.c
@@ -131,7 +131,7 @@ static void scale_image(struct vf_priv_s* priv, mp_image_t *mpi)
dst_stride[0] = priv->stride;
if (!priv->buffer)
- priv->buffer = memalign(16, dst_stride[0]*priv->dh);
+ priv->buffer = av_malloc(dst_stride[0]*priv->dh);
dst[0] = priv->buffer;
sws_scale(priv->ctx, mpi->planes, mpi->stride, 0, priv->dh, dst, dst_stride);
@@ -144,7 +144,7 @@ static void start_slice(struct vf_instance* vf, mp_image_t *mpi)
if (vf->priv->shot) {
vf->priv->store_slices = 1;
if (!vf->priv->buffer)
- vf->priv->buffer = memalign(16, vf->priv->stride*vf->priv->dh);
+ vf->priv->buffer = av_malloc(vf->priv->stride*vf->priv->dh);
}
}
@@ -277,7 +277,7 @@ static void uninit(vf_instance_t *vf)
avcodec_close(vf->priv->avctx);
av_freep(&vf->priv->avctx);
if(vf->priv->ctx) sws_freeContext(vf->priv->ctx);
- if (vf->priv->buffer) free(vf->priv->buffer);
+ if (vf->priv->buffer) av_free(vf->priv->buffer);
free(vf->priv->outbuffer);
free(vf->priv);
}
diff --git a/libmpcodecs/vf_unsharp.c b/libmpcodecs/vf_unsharp.c
index 2afd866342..5d6b33f290 100644
--- a/libmpcodecs/vf_unsharp.c
+++ b/libmpcodecs/vf_unsharp.c
@@ -143,7 +143,7 @@ static int config( struct vf_instance* vf,
stepsX = fp->msizeX/2;
stepsY = fp->msizeY/2;
for( z=0; z<2*stepsY; z++ )
- fp->SC[z] = memalign( 16, sizeof(*(fp->SC[z])) * (width+2*stepsX) );
+ fp->SC[z] = av_malloc(sizeof(*(fp->SC[z])) * (width+2*stepsX));
fp = &vf->priv->chromaParam;
effect = fp->amount == 0 ? "don't touch" : fp->amount < 0 ? "blur" : "sharpen";
@@ -152,7 +152,7 @@ static int config( struct vf_instance* vf,
stepsX = fp->msizeX/2;
stepsY = fp->msizeY/2;
for( z=0; z<2*stepsY; z++ )
- fp->SC[z] = memalign( 16, sizeof(*(fp->SC[z])) * (width+2*stepsX) );
+ fp->SC[z] = av_malloc(sizeof(*(fp->SC[z])) * (width+2*stepsX));
return vf_next_config( vf, width, height, d_width, d_height, flags, outfmt );
}
@@ -212,12 +212,12 @@ static void uninit( struct vf_instance* vf ) {
fp = &vf->priv->lumaParam;
for( z=0; z<sizeof(fp->SC)/sizeof(fp->SC[0]); z++ ) {
- if( fp->SC[z] ) free( fp->SC[z] );
+ if( fp->SC[z] ) av_free( fp->SC[z] );
fp->SC[z] = NULL;
}
fp = &vf->priv->chromaParam;
for( z=0; z<sizeof(fp->SC)/sizeof(fp->SC[0]); z++ ) {
- if( fp->SC[z] ) free( fp->SC[z] );
+ if( fp->SC[z] ) av_free( fp->SC[z] );
fp->SC[z] = NULL;
}