libmpcodecs: some hunks from mplayer HEAD
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
65655a0499
commit
5aa18fed84
@ -27,7 +27,6 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "mp_msg.h"
|
||||
#include "cpudetect.h"
|
||||
|
||||
#include "img_format.h"
|
||||
#include "mp_image.h"
|
||||
|
@ -92,7 +92,6 @@ struct vf_priv_s {
|
||||
|
||||
static void filter(struct vf_priv_s *p, uint8_t *dst[3], uint8_t *src[3], int dst_stride[3], int src_stride[3], int width, int height){
|
||||
int x, y, i;
|
||||
int out_size;
|
||||
|
||||
for(i=0; i<3; i++){
|
||||
p->frame->data[i]= src[i];
|
||||
@ -102,7 +101,7 @@ static void filter(struct vf_priv_s *p, uint8_t *dst[3], uint8_t *src[3], int ds
|
||||
p->avctx_enc->me_cmp=
|
||||
p->avctx_enc->me_sub_cmp= FF_CMP_SAD /*| (p->parity ? FF_CMP_ODD : FF_CMP_EVEN)*/;
|
||||
p->frame->quality= p->qp*FF_QP2LAMBDA;
|
||||
out_size = avcodec_encode_video(p->avctx_enc, p->outbuf, p->outbuf_size, p->frame);
|
||||
avcodec_encode_video(p->avctx_enc, p->outbuf, p->outbuf_size, p->frame);
|
||||
p->frame_dec = p->avctx_enc->coded_frame;
|
||||
|
||||
for(i=0; i<3; i++){
|
||||
|
@ -32,6 +32,8 @@
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include "libavutil/mem.h"
|
||||
|
||||
#include "img_format.h"
|
||||
#include "mp_image.h"
|
||||
#include "vf.h"
|
||||
|
@ -34,6 +34,8 @@
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include "libavutil/mem.h"
|
||||
|
||||
#include "img_format.h"
|
||||
#include "mp_image.h"
|
||||
#include "vf.h"
|
||||
|
@ -22,7 +22,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file vf_remove_logo.c
|
||||
* \file
|
||||
*
|
||||
* \brief Advanced blur-based logo removing filter.
|
||||
|
||||
|
@ -66,6 +66,8 @@ struct vf_priv_s {
|
||||
//FIXME stupid code duplication
|
||||
static void getSubSampleFactors(int *h, int *v, int format){
|
||||
switch(format){
|
||||
default:
|
||||
assert(0);
|
||||
case IMGFMT_YV12:
|
||||
case IMGFMT_I420:
|
||||
*h=1;
|
||||
|
@ -53,6 +53,8 @@ struct vf_priv_s {
|
||||
//FIXME stupid code duplication
|
||||
static void getSubSampleFactors(int *h, int *v, int format){
|
||||
switch(format){
|
||||
default:
|
||||
assert(0);
|
||||
case IMGFMT_YV12:
|
||||
case IMGFMT_I420:
|
||||
*h=1;
|
||||
|
@ -175,12 +175,12 @@ static void filter(struct vf_priv_s *p, uint8_t *dst[3], uint8_t *src[3], int ds
|
||||
for(i=0; i<count; i++){
|
||||
const int x1= offset[i+count-1][0];
|
||||
const int y1= offset[i+count-1][1];
|
||||
int offset, out_size;
|
||||
int offset;
|
||||
p->frame->data[0]= p->src[0] + x1 + y1 * p->frame->linesize[0];
|
||||
p->frame->data[1]= p->src[1] + x1/2 + y1/2 * p->frame->linesize[1];
|
||||
p->frame->data[2]= p->src[2] + x1/2 + y1/2 * p->frame->linesize[2];
|
||||
|
||||
out_size = avcodec_encode_video(p->avctx_enc[i], p->outbuf, p->outbuf_size, p->frame);
|
||||
avcodec_encode_video(p->avctx_enc[i], p->outbuf, p->outbuf_size, p->frame);
|
||||
p->frame_dec = p->avctx_enc[i]->coded_frame;
|
||||
|
||||
offset= (BLOCK-x1) + (BLOCK-y1)*p->frame_dec->linesize[0];
|
||||
|
Loading…
Reference in New Issue
Block a user