mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-08-05 18:59:59 +02:00
support doing motion estimation and compensation without any residual transform or coding
this is usefull for filters which need ME/MC Originally committed as revision 5456 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
a9d4a6ef34
commit
086bfd256e
@ -343,6 +343,7 @@ extern int motion_estimation_method;
|
|||||||
#define CODEC_FLAG2_AUD 0x00000200 ///< H.264 access unit delimiters
|
#define CODEC_FLAG2_AUD 0x00000200 ///< H.264 access unit delimiters
|
||||||
#define CODEC_FLAG2_BRDO 0x00000400 ///< b-frame rate-distortion optimization
|
#define CODEC_FLAG2_BRDO 0x00000400 ///< b-frame rate-distortion optimization
|
||||||
#define CODEC_FLAG2_INTRA_VLC 0x00000800 ///< use MPEG-2 intra VLC table
|
#define CODEC_FLAG2_INTRA_VLC 0x00000800 ///< use MPEG-2 intra VLC table
|
||||||
|
#define CODEC_FLAG2_MEMC_ONLY 0x00001000 ///< only do ME/MC (I frames -> ref, P frame -> ME+MC)
|
||||||
|
|
||||||
/* Unsupported options :
|
/* Unsupported options :
|
||||||
* Syntax Arithmetic coding (SAC)
|
* Syntax Arithmetic coding (SAC)
|
||||||
|
@ -4261,6 +4261,7 @@ redo_frame:
|
|||||||
int x, y;
|
int x, y;
|
||||||
// int bits= put_bits_count(&s->c.pb);
|
// int bits= put_bits_count(&s->c.pb);
|
||||||
|
|
||||||
|
if(!(avctx->flags2 & CODEC_FLAG2_MEMC_ONLY)){
|
||||||
//FIXME optimize
|
//FIXME optimize
|
||||||
if(pict->data[plane_index]) //FIXME gray hack
|
if(pict->data[plane_index]) //FIXME gray hack
|
||||||
for(y=0; y<h; y++){
|
for(y=0; y<h; y++){
|
||||||
@ -4330,6 +4331,20 @@ redo_frame:
|
|||||||
{START_TIMER
|
{START_TIMER
|
||||||
predict_plane(s, s->spatial_dwt_buffer, plane_index, 1);
|
predict_plane(s, s->spatial_dwt_buffer, plane_index, 1);
|
||||||
STOP_TIMER("pred-conv")}
|
STOP_TIMER("pred-conv")}
|
||||||
|
}else{
|
||||||
|
//ME/MC only
|
||||||
|
if(pict->pict_type == I_TYPE){
|
||||||
|
for(y=0; y<h; y++){
|
||||||
|
for(x=0; x<w; x++){
|
||||||
|
s->current_picture.data[plane_index][y*s->current_picture.linesize[plane_index] + x]=
|
||||||
|
pict->data[plane_index][y*pict->linesize[plane_index] + x];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
memset(s->spatial_dwt_buffer, 0, sizeof(DWTELEM)*w*h);
|
||||||
|
predict_plane(s, s->spatial_dwt_buffer, plane_index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
if(s->avctx->flags&CODEC_FLAG_PSNR){
|
if(s->avctx->flags&CODEC_FLAG_PSNR){
|
||||||
int64_t error= 0;
|
int64_t error= 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user