Unified · Split
| @@ -91,15 +91,6 @@ void ff_h263_update_motion_val(MpegEncContext * s){ · 90 unmodified lines | |||
| 91 | s->current_picture.motion_val[0][xy + 1 + wrap][0] = motion_x; | 91 | s->current_picture.motion_val[0][xy + 1 + wrap][0] = motion_x; |
| 92 | s->current_picture.motion_val[0][xy + 1 + wrap][1] = motion_y; | 92 | s->current_picture.motion_val[0][xy + 1 + wrap][1] = motion_y; |
| 93 | } | 93 | } |
| 94 | |||
| 95 | if(s->encoding){ //FIXME encoding MUST be cleaned up | ||
| 96 | if (s->mv_type == MV_TYPE_8X8) | ||
| 97 | s->current_picture.mb_type[mb_xy] = MB_TYPE_L0 | MB_TYPE_8x8; | ||
| 98 | else if(s->mb_intra) | ||
| 99 | s->current_picture.mb_type[mb_xy] = MB_TYPE_INTRA; | ||
| 100 | else | ||
| 101 | s->current_picture.mb_type[mb_xy] = MB_TYPE_L0 | MB_TYPE_16x16; | ||
| 102 | } | ||
| 103 | } | 94 | } |
| 104 | 95 | ||
| 105 | void ff_h263_loop_filter(MpegEncContext * s){ | 96 | void ff_h263_loop_filter(MpegEncContext * s){ |
| @@ -36,7 +36,7 @@ void ff_init_qscale_tab(MpegEncContext *s); · 35 unmodified lines | |||
| 36 | void ff_clean_h263_qscales(MpegEncContext *s); | 36 | void ff_clean_h263_qscales(MpegEncContext *s); |
| 37 | 37 | ||
| 38 | void ff_h263_encode_motion(PutBitContext *pb, int val, int f_code); | 38 | void ff_h263_encode_motion(PutBitContext *pb, int val, int f_code); |
| 39 | 39 | void ff_h263_update_mb(MpegEncContext *s); | |
| 40 | 40 | ||
| 41 | static inline int h263_get_motion_length(int val, int f_code) | 41 | static inline int h263_get_motion_length(int val, int f_code) |
| 42 | { | 42 | { |
| @@ -688,6 +688,20 @@ void ff_h263_encode_mb(MpegEncContext * s, · 687 unmodified lines | |||
| 688 | } | 688 | } |
| 689 | } | 689 | } |
| 690 | 690 | ||
| 691 | void ff_h263_update_mb(MpegEncContext *s) | ||
| 692 | { | ||
| 693 | const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; | ||
| 694 | |||
| 695 | if (s->mv_type == MV_TYPE_8X8) | ||
| 696 | s->current_picture.mb_type[mb_xy] = MB_TYPE_L0 | MB_TYPE_8x8; | ||
| 697 | else if(s->mb_intra) | ||
| 698 | s->current_picture.mb_type[mb_xy] = MB_TYPE_INTRA; | ||
| 699 | else | ||
| 700 | s->current_picture.mb_type[mb_xy] = MB_TYPE_L0 | MB_TYPE_16x16; | ||
| 701 | |||
| 702 | ff_h263_update_motion_val(s); | ||
| 703 | } | ||
| 704 | |||
| 691 | void ff_h263_encode_motion(PutBitContext *pb, int val, int f_code) | 705 | void ff_h263_encode_motion(PutBitContext *pb, int val, int f_code) |
| 692 | { | 706 | { |
| 693 | int range, bit_size, sign, code, bits; | 707 | int range, bit_size, sign, code, bits; |
| @@ -3314,7 +3314,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 3313 unmodified lines | |||
| 3314 | 3314 | ||
| 3315 | if (CONFIG_H263_ENCODER && | 3315 | if (CONFIG_H263_ENCODER && |
| 3316 | s->out_format == FMT_H263 && s->pict_type!=AV_PICTURE_TYPE_B) | 3316 | s->out_format == FMT_H263 && s->pict_type!=AV_PICTURE_TYPE_B) |
| 3317 | ff_h263_update_motion_val(s); | 3317 | ff_h263_update_mb(s); |
| 3318 | 3318 | ||
| 3319 | if(next_block==0){ //FIXME 16 vs linesize16 | 3319 | if(next_block==0){ //FIXME 16 vs linesize16 |
| 3320 | s->hdsp.put_pixels_tab[0][0](s->dest[0], s->sc.rd_scratchpad , s->linesize ,16); | 3320 | s->hdsp.put_pixels_tab[0][0](s->dest[0], s->sc.rd_scratchpad , s->linesize ,16); |
| @@ -3440,7 +3440,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 119 unmodified lines | |||
| 3440 | 3440 | ||
| 3441 | if (CONFIG_H263_ENCODER && | 3441 | if (CONFIG_H263_ENCODER && |
| 3442 | s->out_format == FMT_H263 && s->pict_type!=AV_PICTURE_TYPE_B) | 3442 | s->out_format == FMT_H263 && s->pict_type!=AV_PICTURE_TYPE_B) |
| 3443 | ff_h263_update_motion_val(s); | 3443 | ff_h263_update_mb(s); |
| 3444 | 3444 | ||
| 3445 | mpv_reconstruct_mb(s, s->block); | 3445 | mpv_reconstruct_mb(s, s->block); |
| 3446 | } | 3446 | } |