mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
exchange the values of MV_DIR_FORWARD and MV_DIR_BACKWARD (this is more sane,
matches the order of some other stuff and allows some simplifications) Originally committed as revision 9864 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
04b502fa36
commit
653f738780
@ -910,7 +910,7 @@ void mpeg4_encode_mb(MpegEncContext * s,
|
||||
int i, cbp;
|
||||
|
||||
if(s->pict_type==B_TYPE){
|
||||
static const int mb_type_table[8]= {-1, 2, 3, 1,-1,-1,-1, 0}; /* convert from mv_dir to type */
|
||||
static const int mb_type_table[8]= {-1, 3, 2, 1,-1,-1,-1, 0}; /* convert from mv_dir to type */
|
||||
int mb_type= mb_type_table[s->mv_dir];
|
||||
|
||||
if(s->mb_x==0){
|
||||
|
@ -383,7 +383,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
|
||||
s->mv_type = MV_TYPE_16X16;
|
||||
for(i=0;i<2;i++) {
|
||||
if (USES_LIST(mb_type, i)) {
|
||||
s->mv_dir |= (MV_DIR_FORWARD >> i);
|
||||
s->mv_dir |= (MV_DIR_FORWARD << i);
|
||||
/* MT_FRAME */
|
||||
s->mv[i][0][0]= s->last_mv[i][0][0]= s->last_mv[i][1][0] =
|
||||
mpeg_decode_motion(s, s->mpeg_f_code[i][0], s->last_mv[i][0][0]);
|
||||
@ -401,7 +401,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
|
||||
s->mv_type = MV_TYPE_16X8;
|
||||
for(i=0;i<2;i++) {
|
||||
if (USES_LIST(mb_type, i)) {
|
||||
s->mv_dir |= (MV_DIR_FORWARD >> i);
|
||||
s->mv_dir |= (MV_DIR_FORWARD << i);
|
||||
/* MT_16X8 */
|
||||
for(j=0;j<2;j++) {
|
||||
s->field_select[i][j] = get_bits1(&s->gb);
|
||||
@ -422,7 +422,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
|
||||
mb_type |= MB_TYPE_16x8 | MB_TYPE_INTERLACED;
|
||||
for(i=0;i<2;i++) {
|
||||
if (USES_LIST(mb_type, i)) {
|
||||
s->mv_dir |= (MV_DIR_FORWARD >> i);
|
||||
s->mv_dir |= (MV_DIR_FORWARD << i);
|
||||
for(j=0;j<2;j++) {
|
||||
s->field_select[i][j] = get_bits1(&s->gb);
|
||||
val = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
|
||||
@ -442,7 +442,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
|
||||
mb_type |= MB_TYPE_16x16 | MB_TYPE_INTERLACED;
|
||||
for(i=0;i<2;i++) {
|
||||
if (USES_LIST(mb_type, i)) {
|
||||
s->mv_dir |= (MV_DIR_FORWARD >> i);
|
||||
s->mv_dir |= (MV_DIR_FORWARD << i);
|
||||
s->field_select[i][0] = get_bits1(&s->gb);
|
||||
for(k=0;k<2;k++) {
|
||||
val = mpeg_decode_motion(s, s->mpeg_f_code[i][k],
|
||||
@ -460,7 +460,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
|
||||
for(i=0;i<2;i++) {
|
||||
if (USES_LIST(mb_type, i)) {
|
||||
int dmx, dmy, mx, my, m;
|
||||
s->mv_dir |= (MV_DIR_FORWARD >> i);
|
||||
s->mv_dir |= (MV_DIR_FORWARD << i);
|
||||
mx = mpeg_decode_motion(s, s->mpeg_f_code[i][0],
|
||||
s->last_mv[i][0][0]);
|
||||
s->last_mv[i][0][0] = mx;
|
||||
|
@ -562,7 +562,7 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
|
||||
}
|
||||
s->f_count++;
|
||||
} else{
|
||||
static const int mb_type_len[4]={0,3,4,2}; //bak,for,bi
|
||||
static const int mb_type_len[4]={0,4,3,2}; //bak,for,bi
|
||||
|
||||
if(s->mv_type == MV_TYPE_16X16){
|
||||
if (cbp){ // With coded bloc pattern
|
||||
|
@ -368,8 +368,8 @@ typedef struct MpegEncContext {
|
||||
uint8_t (*b_field_select_table[2][2]);
|
||||
int me_method; ///< ME algorithm
|
||||
int mv_dir;
|
||||
#define MV_DIR_BACKWARD 1
|
||||
#define MV_DIR_FORWARD 2
|
||||
#define MV_DIR_FORWARD 1
|
||||
#define MV_DIR_BACKWARD 2
|
||||
#define MV_DIRECT 4 ///< bidirectional mode where the difference equals the MV of the last P/S/I-Frame (mpeg4)
|
||||
int mv_type;
|
||||
#define MV_TYPE_16X16 0 ///< 1 vector for the whole mb
|
||||
|
Loading…
Reference in New Issue
Block a user