提交 c92a30bb 编写于 作者: K Kostya Shishkov

Move H.264 intra prediction functions into their own context

Originally committed as revision 10397 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 6a1aa752
......@@ -85,7 +85,7 @@ OBJS-$(CONFIG_H263_DECODER) += h263dec.o h263.o
OBJS-$(CONFIG_H263I_DECODER) += h263dec.o h263.o
OBJS-$(CONFIG_H263_ENCODER) += mpegvideo_enc.o motion_est.o ratecontrol.o h263.o
OBJS-$(CONFIG_H263P_ENCODER) += mpegvideo_enc.o motion_est.o ratecontrol.o h263.o
OBJS-$(CONFIG_H264_DECODER) += h264.o h264idct.o cabac.o golomb.o
OBJS-$(CONFIG_H264_DECODER) += h264.o h264idct.o h264pred.o cabac.o golomb.o
OBJS-$(CONFIG_H264_ENCODER) += h264enc.o h264dspenc.o
OBJS-$(CONFIG_HUFFYUV_DECODER) += huffyuv.o
OBJS-$(CONFIG_HUFFYUV_ENCODER) += huffyuv.o
......@@ -167,7 +167,7 @@ OBJS-$(CONFIG_SONIC_LS_ENCODER) += sonic.o golomb.o
OBJS-$(CONFIG_SP5X_DECODER) += sp5xdec.o mjpegdec.o mjpeg.o
OBJS-$(CONFIG_SVQ1_DECODER) += svq1dec.o svq1.o h263.o
OBJS-$(CONFIG_SVQ1_ENCODER) += svq1enc.o svq1.o motion_est.o h263.o
OBJS-$(CONFIG_SVQ3_DECODER) += h264.o h264idct.o cabac.o golomb.o
OBJS-$(CONFIG_SVQ3_DECODER) += h264.o h264idct.o h264pred.o cabac.o golomb.o
OBJS-$(CONFIG_TARGA_DECODER) += targa.o
OBJS-$(CONFIG_TARGA_ENCODER) += targaenc.o rle.o
OBJS-$(CONFIG_THEORA_DECODER) += vp3.o xiph.o vp3dsp.o
......
此差异已折叠。
......@@ -31,6 +31,7 @@
#include "dsputil.h"
#include "cabac.h"
#include "mpegvideo.h"
#include "h264pred.h"
#define interlaced_dct interlaced_dct_is_a_bad_name
#define mb_intra mb_intra_is_not_initialized_see_mb_type
......@@ -185,10 +186,7 @@ typedef struct H264Context{
int8_t intra4x4_pred_mode_cache[5*8];
int8_t (*intra4x4_pred_mode)[8];
void (*pred4x4 [9+3])(uint8_t *src, uint8_t *topright, int stride);//FIXME move to dsp?
void (*pred8x8l [9+3])(uint8_t *src, int topleft, int topright, int stride);
void (*pred8x8 [4+3])(uint8_t *src, int stride);
void (*pred16x16[4+3])(uint8_t *src, int stride);
H264PredContext hpc;
unsigned int topleft_samples_available;
unsigned int top_samples_available;
unsigned int topright_samples_available;
......
......@@ -33,29 +33,6 @@
#include "mpegvideo.h"
#include "rational.h"
#define VERT_PRED 0
#define HOR_PRED 1
#define DC_PRED 2
#define DIAG_DOWN_LEFT_PRED 3
#define DIAG_DOWN_RIGHT_PRED 4
#define VERT_RIGHT_PRED 5
#define HOR_DOWN_PRED 6
#define VERT_LEFT_PRED 7
#define HOR_UP_PRED 8
#define LEFT_DC_PRED 9
#define TOP_DC_PRED 10
#define DC_128_PRED 11
#define DC_PRED8x8 0
#define HOR_PRED8x8 1
#define VERT_PRED8x8 2
#define PLANE_PRED8x8 3
#define LEFT_DC_PRED8x8 4
#define TOP_DC_PRED8x8 5
#define DC_128_PRED8x8 6
#define EXTENDED_SAR 255
......
此差异已折叠。
/*
* H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder
* Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file h264pred.h
* H.264 / AVC / MPEG4 prediction functions.
* @author Michael Niedermayer <michaelni@gmx.at>
*/
#ifndef H264PRED_H
#define H264PRED_H
#include "common.h"
/**
* Prediction types
*/
//@{
#define VERT_PRED 0
#define HOR_PRED 1
#define DC_PRED 2
#define DIAG_DOWN_LEFT_PRED 3
#define DIAG_DOWN_RIGHT_PRED 4
#define VERT_RIGHT_PRED 5
#define HOR_DOWN_PRED 6
#define VERT_LEFT_PRED 7
#define HOR_UP_PRED 8
#define LEFT_DC_PRED 9
#define TOP_DC_PRED 10
#define DC_128_PRED 11
#define DIAG_DOWN_LEFT_PRED_RV40_NODOWN 12
#define HOR_UP_PRED_RV40_NODOWN 13
#define DC_PRED8x8 0
#define HOR_PRED8x8 1
#define VERT_PRED8x8 2
#define PLANE_PRED8x8 3
#define LEFT_DC_PRED8x8 4
#define TOP_DC_PRED8x8 5
#define DC_128_PRED8x8 6
//@}
/**
* Context for storing H.264 prediction functions
*/
typedef struct H264PredContext{
void (*pred4x4 [9+3+2])(uint8_t *src, uint8_t *topright, int stride);//FIXME move to dsp?
void (*pred8x8l [9+3])(uint8_t *src, int topleft, int topright, int stride);
void (*pred8x8 [4+3])(uint8_t *src, int stride);
void (*pred16x16[4+3])(uint8_t *src, int stride);
}H264PredContext;
void ff_h264_pred_init(H264PredContext *h, int codec_id);
#endif /* H264PRED_H */
......@@ -180,34 +180,6 @@ static void svq3_add_idct_c (uint8_t *dst, DCTELEM *block, int stride, int qp, i
}
}
static void pred4x4_down_left_svq3_c(uint8_t *src, uint8_t *topright, int stride){
LOAD_TOP_EDGE
LOAD_LEFT_EDGE
const av_unused int unu0= t0;
const av_unused int unu1= l0;
src[0+0*stride]=(l1 + t1)>>1;
src[1+0*stride]=
src[0+1*stride]=(l2 + t2)>>1;
src[2+0*stride]=
src[1+1*stride]=
src[0+2*stride]=
src[3+0*stride]=
src[2+1*stride]=
src[1+2*stride]=
src[0+3*stride]=
src[3+1*stride]=
src[2+2*stride]=
src[1+3*stride]=
src[3+2*stride]=
src[2+3*stride]=
src[3+3*stride]=(l3 + t3)>>1;
}
static void pred16x16_plane_svq3_c(uint8_t *src, int stride){
pred16x16_plane_compat_c(src, stride, 1);
}
static inline int svq3_decode_block (GetBitContext *gb, DCTELEM *block,
int index, const int type) {
......@@ -802,8 +774,6 @@ static int svq3_decode_frame (AVCodecContext *avctx,
if (!s->context_initialized) {
s->width = avctx->width;
s->height = avctx->height;
h->pred4x4[DIAG_DOWN_LEFT_PRED] = pred4x4_down_left_svq3_c;
h->pred16x16[PLANE_PRED8x8] = pred16x16_plane_svq3_c;
h->halfpel_flag = 1;
h->thirdpel_flag = 1;
h->unknown_svq3_flag = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册