mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-08-17 14:55:06 +02:00
Port recent changes to MPlayer libmpcodecs.
Also include an older fix for vf_smartblur which was essentially broken due to reading the threshold value wrongly.
This commit is contained in:
parent
2a30df09fd
commit
3379531c40
@ -598,7 +598,8 @@ static void uninit(struct vf_instance *vf)
|
||||
static int vf_open(vf_instance_t *vf, char *args)
|
||||
{
|
||||
struct vf_priv_s *p;
|
||||
char *filename="framediff.log", *ap, *q, *a;
|
||||
const char *filename="framediff.log";
|
||||
char *ap, *q, *a;
|
||||
|
||||
if(args && !(args=av_strdup(args)))
|
||||
{
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "img_format.h"
|
||||
#include "mp_image.h"
|
||||
#include "vf.h"
|
||||
#include "libavutil/attributes.h"
|
||||
|
||||
typedef void (pack_func_t)(unsigned char *dst, unsigned char *y,
|
||||
unsigned char *u, unsigned char *v, int w, int us, int vs);
|
||||
@ -38,7 +39,8 @@ struct vf_priv_s {
|
||||
};
|
||||
|
||||
static void pack_nn_C(unsigned char *dst, unsigned char *y,
|
||||
unsigned char *u, unsigned char *v, int w)
|
||||
unsigned char *u, unsigned char *v, int w,
|
||||
int av_unused us, int av_unused vs)
|
||||
{
|
||||
int j;
|
||||
for (j = w/2; j; j--) {
|
||||
@ -77,7 +79,8 @@ static void pack_li_1_C(unsigned char *dst, unsigned char *y,
|
||||
|
||||
#if HAVE_MMX
|
||||
static void pack_nn_MMX(unsigned char *dst, unsigned char *y,
|
||||
unsigned char *u, unsigned char *v, int w)
|
||||
unsigned char *u, unsigned char *v, int w,
|
||||
int av_unused us, int av_unused vs)
|
||||
{
|
||||
__asm__ volatile (""
|
||||
ASMALIGN(4)
|
||||
@ -103,7 +106,7 @@ static void pack_nn_MMX(unsigned char *dst, unsigned char *y,
|
||||
: "r" (y), "r" (u), "r" (v), "r" (dst), "r" (w/8)
|
||||
: "memory"
|
||||
);
|
||||
pack_nn_C(dst, y, u, v, (w&7));
|
||||
pack_nn_C(dst, y, u, v, (w&7), 0, 0);
|
||||
}
|
||||
|
||||
#if HAVE_EBX_AVAILABLE
|
||||
@ -413,12 +416,12 @@ static int vf_open(vf_instance_t *vf, char *args)
|
||||
vf->priv->mode = 1;
|
||||
if (args) sscanf(args, "%d", &vf->priv->mode);
|
||||
|
||||
pack_nn = (pack_func_t *)pack_nn_C;
|
||||
pack_nn = pack_nn_C;
|
||||
pack_li_0 = pack_li_0_C;
|
||||
pack_li_1 = pack_li_1_C;
|
||||
#if HAVE_MMX
|
||||
if(gCpuCaps.hasMMX) {
|
||||
pack_nn = (pack_func_t *)pack_nn_MMX;
|
||||
pack_nn = pack_nn_MMX;
|
||||
#if HAVE_EBX_AVAILABLE
|
||||
pack_li_0 = pack_li_0_MMX;
|
||||
pack_li_1 = pack_li_1_MMX;
|
||||
|
@ -286,8 +286,8 @@ static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src, int dst_stri
|
||||
int x, y;
|
||||
const int stride= is_luma ? p->temp_stride : ((width+16+15)&(~15));
|
||||
uint8_t *p_src= p->src + 8*stride;
|
||||
DCTELEM *block= p->src;
|
||||
DCTELEM *temp= p->src + 32;
|
||||
DCTELEM *block= (DCTELEM *)p->src;
|
||||
DCTELEM *temp= (DCTELEM *)(p->src + 32);
|
||||
|
||||
if (!src || !dst) return; // HACK avoid crash for Y8 colourspace
|
||||
for(y=0; y<height; y++){
|
||||
|
@ -183,11 +183,11 @@ static inline void blur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride,
|
||||
static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){
|
||||
int cw= mpi->w >> mpi->chroma_x_shift;
|
||||
int ch= mpi->h >> mpi->chroma_y_shift;
|
||||
FilterParam *f= &vf->priv;
|
||||
int threshold = vf->priv->luma.threshold || vf->priv->chroma.threshold;
|
||||
|
||||
mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
|
||||
MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE|
|
||||
(f->threshold) ? MP_IMGFLAG_READABLE : 0,
|
||||
(threshold ? MP_IMGFLAG_READABLE : 0),
|
||||
mpi->w,mpi->h);
|
||||
|
||||
assert(mpi->flags&MP_IMGFLAG_PLANAR);
|
||||
|
@ -132,7 +132,7 @@ static int config( struct vf_instance *vf,
|
||||
|
||||
int z, stepsX, stepsY;
|
||||
FilterParam *fp;
|
||||
char *effect;
|
||||
const char *effect;
|
||||
|
||||
// allocate buffers
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user