| @@ -369,7 +369,7 @@ static int rv34_decode_intra_mb_header(RV34DecContext *r, int8_t *intra_types) · 368 unmodified lines |
| 369 | | 369 | |
| 370 | r->is16 = get_bits1(gb); | 370 | r->is16 = get_bits1(gb); |
| 371 | if(r->is16){ | 371 | if(r->is16){ |
| 372 | s->cur_pic_ptr->mb_type[mb_pos] = MB_TYPE_INTRA16x16; | 372 | s->cur_pic.mb_type[mb_pos] = MB_TYPE_INTRA16x16; |
| 373 | r->block_type = RV34_MB_TYPE_INTRA16x16; | 373 | r->block_type = RV34_MB_TYPE_INTRA16x16; |
| 374 | t = get_bits(gb, 2); | 374 | t = get_bits(gb, 2); |
| 375 | fill_rectangle(intra_types, 4, 4, r->intra_types_stride, t, sizeof(intra_types[0])); | 375 | fill_rectangle(intra_types, 4, 4, r->intra_types_stride, t, sizeof(intra_types[0])); |
| @@ -379,7 +379,7 @@ static int rv34_decode_intra_mb_header(RV34DecContext *r, int8_t *intra_types) · 3 unmodified lines |
| 379 | if(!get_bits1(gb)) | 379 | if(!get_bits1(gb)) |
| 380 | av_log(s->avctx, AV_LOG_ERROR, "Need DQUANT\n"); | 380 | av_log(s->avctx, AV_LOG_ERROR, "Need DQUANT\n"); |
| 381 | } | 381 | } |
| 382 | s->cur_pic_ptr->mb_type[mb_pos] = MB_TYPE_INTRA; | 382 | s->cur_pic.mb_type[mb_pos] = MB_TYPE_INTRA; |
| 383 | r->block_type = RV34_MB_TYPE_INTRA; | 383 | r->block_type = RV34_MB_TYPE_INTRA; |
| 384 | if(r->decode_intra_types(r, gb, intra_types) < 0) | 384 | if(r->decode_intra_types(r, gb, intra_types) < 0) |
| 385 | return -1; | 385 | return -1; |
| @@ -405,7 +405,7 @@ static int rv34_decode_inter_mb_header(RV34DecContext *r, int8_t *intra_types) · 19 unmodified lines |
| 405 | r->block_type = r->decode_mb_info(r); | 405 | r->block_type = r->decode_mb_info(r); |
| 406 | if(r->block_type == -1) | 406 | if(r->block_type == -1) |
| 407 | return -1; | 407 | return -1; |
| 408 | s->cur_pic_ptr->mb_type[mb_pos] = rv34_mb_type_to_lavc[r->block_type]; | 408 | s->cur_pic.mb_type[mb_pos] = rv34_mb_type_to_lavc[r->block_type]; |
| 409 | r->mb_type[mb_pos] = r->block_type; | 409 | r->mb_type[mb_pos] = r->block_type; |
| 410 | if(r->block_type == RV34_MB_SKIP){ | 410 | if(r->block_type == RV34_MB_SKIP){ |
| 411 | if(s->pict_type == AV_PICTURE_TYPE_P) | 411 | if(s->pict_type == AV_PICTURE_TYPE_P) |
| @@ -413,7 +413,7 @@ static int rv34_decode_inter_mb_header(RV34DecContext *r, int8_t *intra_types) · 1 unmodified line |
| 413 | if(s->pict_type == AV_PICTURE_TYPE_B) | 413 | if(s->pict_type == AV_PICTURE_TYPE_B) |
| 414 | r->mb_type[mb_pos] = RV34_MB_B_DIRECT; | 414 | r->mb_type[mb_pos] = RV34_MB_B_DIRECT; |
| 415 | } | 415 | } |
| 416 | r->is16 = !!IS_INTRA16x16(s->cur_pic_ptr->mb_type[mb_pos]); | 416 | r->is16 = !!IS_INTRA16x16(s->cur_pic.mb_type[mb_pos]); |
| 417 | if (rv34_decode_mv(r, r->block_type) < 0) | 417 | if (rv34_decode_mv(r, r->block_type) < 0) |
| 418 | return -1; | 418 | return -1; |
| 419 | if(r->block_type == RV34_MB_SKIP){ | 419 | if(r->block_type == RV34_MB_SKIP){ |
| @@ -423,7 +423,7 @@ static int rv34_decode_inter_mb_header(RV34DecContext *r, int8_t *intra_types) · 3 unmodified lines |
| 423 | r->chroma_vlc = 1; | 423 | r->chroma_vlc = 1; |
| 424 | r->luma_vlc = 0; | 424 | r->luma_vlc = 0; |
| 425 | | 425 | |
| 426 | if(IS_INTRA(s->cur_pic_ptr->mb_type[mb_pos])){ | 426 | if (IS_INTRA(s->cur_pic.mb_type[mb_pos])) { |
| 427 | if(r->is16){ | 427 | if(r->is16){ |
| 428 | t = get_bits(gb, 2); | 428 | t = get_bits(gb, 2); |
| 429 | fill_rectangle(intra_types, 4, 4, r->intra_types_stride, t, sizeof(intra_types[0])); | 429 | fill_rectangle(intra_types, 4, 4, r->intra_types_stride, t, sizeof(intra_types[0])); |
| @@ -482,33 +482,34 @@ static void rv34_pred_mv(RV34DecContext *r, int block_type, int subblock_no, int · 52 unmodified lines |
| 482 | int mx, my; | 482 | int mx, my; |
| 483 | int* avail = r->avail_cache + avail_indexes[subblock_no]; | 483 | int* avail = r->avail_cache + avail_indexes[subblock_no]; |
| 484 | int c_off = part_sizes_w[block_type]; | 484 | int c_off = part_sizes_w[block_type]; |
| | 485 | int16_t (*motion_val)[2] = s->cur_pic.motion_val[0]; |
| 485 | | 486 | |
| 486 | mv_pos += (subblock_no & 1) + (subblock_no >> 1)*s->b8_stride; | 487 | mv_pos += (subblock_no & 1) + (subblock_no >> 1)*s->b8_stride; |
| 487 | if(subblock_no == 3) | 488 | if(subblock_no == 3) |
| 488 | c_off = -1; | 489 | c_off = -1; |
| 489 | | 490 | |
| 490 | if(avail[-1]){ | 491 | if(avail[-1]){ |
| 491 | A[0] = s->cur_pic_ptr->motion_val[0][mv_pos-1][0]; | 492 | A[0] = motion_val[mv_pos-1][0]; |
| 492 | A[1] = s->cur_pic_ptr->motion_val[0][mv_pos-1][1]; | 493 | A[1] = motion_val[mv_pos-1][1]; |
| 493 | } | 494 | } |
| 494 | if(avail[-4]){ | 495 | if(avail[-4]){ |
| 495 | B[0] = s->cur_pic_ptr->motion_val[0][mv_pos-s->b8_stride][0]; | 496 | B[0] = motion_val[mv_pos-s->b8_stride][0]; |
| 496 | B[1] = s->cur_pic_ptr->motion_val[0][mv_pos-s->b8_stride][1]; | 497 | B[1] = motion_val[mv_pos-s->b8_stride][1]; |
| 497 | }else{ | 498 | }else{ |
| 498 | B[0] = A[0]; | 499 | B[0] = A[0]; |
| 499 | B[1] = A[1]; | 500 | B[1] = A[1]; |
| 500 | } | 501 | } |
| 501 | if(!avail[c_off-4]){ | 502 | if(!avail[c_off-4]){ |
| 502 | if(avail[-4] && (avail[-1] || r->rv30)){ | 503 | if(avail[-4] && (avail[-1] || r->rv30)){ |
| 503 | C[0] = s->cur_pic_ptr->motion_val[0][mv_pos-s->b8_stride-1][0]; | 504 | C[0] = motion_val[mv_pos-s->b8_stride-1][0]; |
| 504 | C[1] = s->cur_pic_ptr->motion_val[0][mv_pos-s->b8_stride-1][1]; | 505 | C[1] = motion_val[mv_pos-s->b8_stride-1][1]; |
| 505 | }else{ | 506 | }else{ |
| 506 | C[0] = A[0]; | 507 | C[0] = A[0]; |
| 507 | C[1] = A[1]; | 508 | C[1] = A[1]; |
| 508 | } | 509 | } |
| 509 | }else{ | 510 | }else{ |
| 510 | C[0] = s->cur_pic_ptr->motion_val[0][mv_pos-s->b8_stride+c_off][0]; | 511 | C[0] = motion_val[mv_pos-s->b8_stride+c_off][0]; |
| 511 | C[1] = s->cur_pic_ptr->motion_val[0][mv_pos-s->b8_stride+c_off][1]; | 512 | C[1] = motion_val[mv_pos-s->b8_stride+c_off][1]; |
| 512 | } | 513 | } |
| 513 | mx = mid_pred(A[0], B[0], C[0]); | 514 | mx = mid_pred(A[0], B[0], C[0]); |
| 514 | my = mid_pred(A[1], B[1], C[1]); | 515 | my = mid_pred(A[1], B[1], C[1]); |
| @@ -516,8 +517,8 @@ static void rv34_pred_mv(RV34DecContext *r, int block_type, int subblock_no, int · 1 unmodified line |
| 516 | my += r->dmv[dmv_no][1]; | 517 | my += r->dmv[dmv_no][1]; |
| 517 | for(j = 0; j < part_sizes_h[block_type]; j++){ | 518 | for(j = 0; j < part_sizes_h[block_type]; j++){ |
| 518 | for(i = 0; i < part_sizes_w[block_type]; i++){ | 519 | for(i = 0; i < part_sizes_w[block_type]; i++){ |
| 519 | s->cur_pic_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][0] = mx; | 520 | motion_val[mv_pos + i + j*s->b8_stride][0] = mx; |
| 520 | s->cur_pic_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][1] = my; | 521 | motion_val[mv_pos + i + j*s->b8_stride][1] = my; |
| 521 | } | 522 | } |
| 522 | } | 523 | } |
| 523 | } | 524 | } |
| @@ -566,7 +567,7 @@ static void rv34_pred_mv_b(RV34DecContext *r, int block_type, int dir) · 42 unmodified lines |
| 566 | int has_A = 0, has_B = 0, has_C = 0; | 567 | int has_A = 0, has_B = 0, has_C = 0; |
| 567 | int mx, my; | 568 | int mx, my; |
| 568 | int i, j; | 569 | int i, j; |
| 569 | Picture *cur_pic = s->cur_pic_ptr; | 570 | Picture *cur_pic = &s->cur_pic; |
| 570 | const int mask = dir ? MB_TYPE_L1 : MB_TYPE_L0; | 571 | const int mask = dir ? MB_TYPE_L1 : MB_TYPE_L0; |
| 571 | int type = cur_pic->mb_type[mb_pos]; | 572 | int type = cur_pic->mb_type[mb_pos]; |
| 572 | | 573 | |
| @@ -619,27 +620,27 @@ static void rv34_pred_mv_rv3(RV34DecContext *r, int block_type, int dir) · 46 unmodified lines |
| 619 | int* avail = r->avail_cache + avail_indexes[0]; | 620 | int* avail = r->avail_cache + avail_indexes[0]; |
| 620 | | 621 | |
| 621 | if(avail[-1]){ | 622 | if(avail[-1]){ |
| 622 | A[0] = s->cur_pic_ptr->motion_val[0][mv_pos - 1][0]; | 623 | A[0] = s->cur_pic.motion_val[0][mv_pos - 1][0]; |
| 623 | A[1] = s->cur_pic_ptr->motion_val[0][mv_pos - 1][1]; | 624 | A[1] = s->cur_pic.motion_val[0][mv_pos - 1][1]; |
| 624 | } | 625 | } |
| 625 | if(avail[-4]){ | 626 | if(avail[-4]){ |
| 626 | B[0] = s->cur_pic_ptr->motion_val[0][mv_pos - s->b8_stride][0]; | 627 | B[0] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride][0]; |
| 627 | B[1] = s->cur_pic_ptr->motion_val[0][mv_pos - s->b8_stride][1]; | 628 | B[1] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride][1]; |
| 628 | }else{ | 629 | }else{ |
| 629 | B[0] = A[0]; | 630 | B[0] = A[0]; |
| 630 | B[1] = A[1]; | 631 | B[1] = A[1]; |
| 631 | } | 632 | } |
| 632 | if(!avail[-4 + 2]){ | 633 | if(!avail[-4 + 2]){ |
| 633 | if(avail[-4] && (avail[-1])){ | 634 | if(avail[-4] && (avail[-1])){ |
| 634 | C[0] = s->cur_pic_ptr->motion_val[0][mv_pos - s->b8_stride - 1][0]; | 635 | C[0] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride - 1][0]; |
| 635 | C[1] = s->cur_pic_ptr->motion_val[0][mv_pos - s->b8_stride - 1][1]; | 636 | C[1] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride - 1][1]; |
| 636 | }else{ | 637 | }else{ |
| 637 | C[0] = A[0]; | 638 | C[0] = A[0]; |
| 638 | C[1] = A[1]; | 639 | C[1] = A[1]; |
| 639 | } | 640 | } |
| 640 | }else{ | 641 | }else{ |
| 641 | C[0] = s->cur_pic_ptr->motion_val[0][mv_pos - s->b8_stride + 2][0]; | 642 | C[0] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride + 2][0]; |
| 642 | C[1] = s->cur_pic_ptr->motion_val[0][mv_pos - s->b8_stride + 2][1]; | 643 | C[1] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride + 2][1]; |
| 643 | } | 644 | } |
| 644 | mx = mid_pred(A[0], B[0], C[0]); | 645 | mx = mid_pred(A[0], B[0], C[0]); |
| 645 | my = mid_pred(A[1], B[1], C[1]); | 646 | my = mid_pred(A[1], B[1], C[1]); |
| @@ -648,8 +649,8 @@ static void rv34_pred_mv_rv3(RV34DecContext *r, int block_type, int dir) · 2 unmodified lines |
| 648 | for(j = 0; j < 2; j++){ | 649 | for(j = 0; j < 2; j++){ |
| 649 | for(i = 0; i < 2; i++){ | 650 | for(i = 0; i < 2; i++){ |
| 650 | for(k = 0; k < 2; k++){ | 651 | for(k = 0; k < 2; k++){ |
| 651 | s->cur_pic_ptr->motion_val[k][mv_pos + i + j*s->b8_stride][0] = mx; | 652 | s->cur_pic.motion_val[k][mv_pos + i + j*s->b8_stride][0] = mx; |
| 652 | s->cur_pic_ptr->motion_val[k][mv_pos + i + j*s->b8_stride][1] = my; | 653 | s->cur_pic.motion_val[k][mv_pos + i + j*s->b8_stride][1] = my; |
| 653 | } | 654 | } |
| 654 | } | 655 | } |
| 655 | } | 656 | } |
| @@ -685,27 +686,28 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type, · 29 unmodified lines |
| 685 | int mv_pos = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride + mv_off; | 686 | int mv_pos = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride + mv_off; |
| 686 | int is16x16 = 1; | 687 | int is16x16 = 1; |
| 687 | int emu = 0; | 688 | int emu = 0; |
| | 689 | int16_t *motion_val = s->cur_pic.motion_val[dir][mv_pos]; |
| 688 | | 690 | |
| 689 | if(thirdpel){ | 691 | if(thirdpel){ |
| 690 | int chroma_mx, chroma_my; | 692 | int chroma_mx, chroma_my; |
| 691 | mx = (s->cur_pic_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) / 3 - (1 << 24); | 693 | mx = (motion_val[0] + (3 << 24)) / 3 - (1 << 24); |
| 692 | my = (s->cur_pic_ptr->motion_val[dir][mv_pos][1] + (3 << 24)) / 3 - (1 << 24); | 694 | my = (motion_val[1] + (3 << 24)) / 3 - (1 << 24); |
| 693 | lx = (s->cur_pic_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) % 3; | 695 | lx = (motion_val[0] + (3 << 24)) % 3; |
| 694 | ly = (s->cur_pic_ptr->motion_val[dir][mv_pos][1] + (3 << 24)) % 3; | 696 | ly = (motion_val[1] + (3 << 24)) % 3; |
| 695 | chroma_mx = s->cur_pic_ptr->motion_val[dir][mv_pos][0] / 2; | 697 | chroma_mx = motion_val[0] / 2; |
| 696 | chroma_my = s->cur_pic_ptr->motion_val[dir][mv_pos][1] / 2; | 698 | chroma_my = motion_val[1] / 2; |
| 697 | umx = (chroma_mx + (3 << 24)) / 3 - (1 << 24); | 699 | umx = (chroma_mx + (3 << 24)) / 3 - (1 << 24); |
| 698 | umy = (chroma_my + (3 << 24)) / 3 - (1 << 24); | 700 | umy = (chroma_my + (3 << 24)) / 3 - (1 << 24); |
| 699 | uvmx = chroma_coeffs[(chroma_mx + (3 << 24)) % 3]; | 701 | uvmx = chroma_coeffs[(chroma_mx + (3 << 24)) % 3]; |
| 700 | uvmy = chroma_coeffs[(chroma_my + (3 << 24)) % 3]; | 702 | uvmy = chroma_coeffs[(chroma_my + (3 << 24)) % 3]; |
| 701 | }else{ | 703 | }else{ |
| 702 | int cx, cy; | 704 | int cx, cy; |
| 703 | mx = s->cur_pic_ptr->motion_val[dir][mv_pos][0] >> 2; | 705 | mx = motion_val[0] >> 2; |
| 704 | my = s->cur_pic_ptr->motion_val[dir][mv_pos][1] >> 2; | 706 | my = motion_val[1] >> 2; |
| 705 | lx = s->cur_pic_ptr->motion_val[dir][mv_pos][0] & 3; | 707 | lx = motion_val[0] & 3; |
| 706 | ly = s->cur_pic_ptr->motion_val[dir][mv_pos][1] & 3; | 708 | ly = motion_val[1] & 3; |
| 707 | cx = s->cur_pic_ptr->motion_val[dir][mv_pos][0] / 2; | 709 | cx = motion_val[0] / 2; |
| 708 | cy = s->cur_pic_ptr->motion_val[dir][mv_pos][1] / 2; | 710 | cy = motion_val[1] / 2; |
| 709 | umx = cx >> 2; | 711 | umx = cx >> 2; |
| 710 | umy = cy >> 2; | 712 | umy = cy >> 2; |
| 711 | uvmx = (cx & 3) << 1; | 713 | uvmx = (cx & 3) << 1; |
| @@ -723,9 +725,9 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type, · 11 unmodified lines |
| 723 | } | 725 | } |
| 724 | | 726 | |
| 725 | dxy = ly*4 + lx; | 727 | dxy = ly*4 + lx; |
| 726 | srcY = dir ? s->next_pic_ptr->f->data[0] : s->last_pic_ptr->f->data[0]; | 728 | srcY = dir ? s->next_pic.data[0] : s->last_pic.data[0]; |
| 727 | srcU = dir ? s->next_pic_ptr->f->data[1] : s->last_pic_ptr->f->data[1]; | 729 | srcU = dir ? s->next_pic.data[1] : s->last_pic.data[1]; |
| 728 | srcV = dir ? s->next_pic_ptr->f->data[2] : s->last_pic_ptr->f->data[2]; | 730 | srcV = dir ? s->next_pic.data[2] : s->last_pic.data[2]; |
| 729 | src_x = s->mb_x * 16 + xoff + mx; | 731 | src_x = s->mb_x * 16 + xoff + mx; |
| 730 | src_y = s->mb_y * 16 + yoff + my; | 732 | src_y = s->mb_y * 16 + yoff + my; |
| 731 | uvsrc_x = s->mb_x * 8 + (xoff >> 1) + umx; | 733 | uvsrc_x = s->mb_x * 8 + (xoff >> 1) + umx; |
| @@ -886,11 +888,11 @@ static int rv34_decode_mv(RV34DecContext *r, int block_type) · 154 unmodified lines |
| 886 | switch(block_type){ | 888 | switch(block_type){ |
| 887 | case RV34_MB_TYPE_INTRA: | 889 | case RV34_MB_TYPE_INTRA: |
| 888 | case RV34_MB_TYPE_INTRA16x16: | 890 | case RV34_MB_TYPE_INTRA16x16: |
| 889 | ZERO8x2(s->cur_pic_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | 891 | ZERO8x2(s->cur_pic.motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); |
| 890 | return 0; | 892 | return 0; |
| 891 | case RV34_MB_SKIP: | 893 | case RV34_MB_SKIP: |
| 892 | if(s->pict_type == AV_PICTURE_TYPE_P){ | 894 | if(s->pict_type == AV_PICTURE_TYPE_P){ |
| 893 | ZERO8x2(s->cur_pic_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | 895 | ZERO8x2(s->cur_pic.motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); |
| 894 | rv34_mc_1mv (r, block_type, 0, 0, 0, 2, 2, 0); | 896 | rv34_mc_1mv (r, block_type, 0, 0, 0, 2, 2, 0); |
| 895 | break; | 897 | break; |
| 896 | } | 898 | } |
| @@ -900,21 +902,21 @@ static int rv34_decode_mv(RV34DecContext *r, int block_type) · 3 unmodified lines |
| 900 | if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) | 902 | if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) |
| 901 | ff_thread_await_progress(&s->next_pic_ptr->tf, FFMAX(0, s->mb_y-1), 0); | 903 | ff_thread_await_progress(&s->next_pic_ptr->tf, FFMAX(0, s->mb_y-1), 0); |
| 902 | | 904 | |
| 903 | next_bt = s->next_pic_ptr->mb_type[s->mb_x + s->mb_y * s->mb_stride]; | 905 | next_bt = s->next_pic.mb_type[s->mb_x + s->mb_y * s->mb_stride]; |
| 904 | if(IS_INTRA(next_bt) || IS_SKIP(next_bt)){ | 906 | if(IS_INTRA(next_bt) || IS_SKIP(next_bt)){ |
| 905 | ZERO8x2(s->cur_pic_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | 907 | ZERO8x2(s->cur_pic.motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); |
| 906 | ZERO8x2(s->cur_pic_ptr->motion_val[1][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | 908 | ZERO8x2(s->cur_pic.motion_val[1][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); |
| 907 | }else | 909 | }else |
| 908 | for(j = 0; j < 2; j++) | 910 | for(j = 0; j < 2; j++) |
| 909 | for(i = 0; i < 2; i++) | 911 | for(i = 0; i < 2; i++) |
| 910 | for(k = 0; k < 2; k++) | 912 | for(k = 0; k < 2; k++) |
| 911 | for(l = 0; l < 2; l++) | 913 | for(l = 0; l < 2; l++) |
| 912 | s->cur_pic_ptr->motion_val[l][mv_pos + i + j*s->b8_stride][k] = calc_add_mv(r, l, s->next_pic_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][k]); | 914 | s->cur_pic.motion_val[l][mv_pos + i + j*s->b8_stride][k] = calc_add_mv(r, l, s->next_pic.motion_val[0][mv_pos + i + j*s->b8_stride][k]); |
| 913 | if(!(IS_16X8(next_bt) || IS_8X16(next_bt) || IS_8X8(next_bt))) //we can use whole macroblock MC | 915 | if(!(IS_16X8(next_bt) || IS_8X16(next_bt) || IS_8X8(next_bt))) //we can use whole macroblock MC |
| 914 | rv34_mc_2mv(r, block_type); | 916 | rv34_mc_2mv(r, block_type); |
| 915 | else | 917 | else |
| 916 | rv34_mc_2mv_skip(r); | 918 | rv34_mc_2mv_skip(r); |
| 917 | ZERO8x2(s->cur_pic_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | 919 | ZERO8x2(s->cur_pic.motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); |
| 918 | break; | 920 | break; |
| 919 | case RV34_MB_P_16x16: | 921 | case RV34_MB_P_16x16: |
| 920 | case RV34_MB_P_MIX16x16: | 922 | case RV34_MB_P_MIX16x16: |
| @@ -1182,7 +1184,7 @@ static int rv34_set_deblock_coef(RV34DecContext *r) · 261 unmodified lines |
| 1182 | MpegEncContext *s = &r->s; | 1184 | MpegEncContext *s = &r->s; |
| 1183 | int hmvmask = 0, vmvmask = 0, i, j; | 1185 | int hmvmask = 0, vmvmask = 0, i, j; |
| 1184 | int midx = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride; | 1186 | int midx = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride; |
| 1185 | int16_t (*motion_val)[2] = &s->cur_pic_ptr->motion_val[0][midx]; | 1187 | int16_t (*motion_val)[2] = &s->cur_pic.motion_val[0][midx]; |
| 1186 | for(j = 0; j < 16; j += 8){ | 1188 | for(j = 0; j < 16; j += 8){ |
| 1187 | for(i = 0; i < 2; i++){ | 1189 | for(i = 0; i < 2; i++){ |
| 1188 | if(is_mv_diff_gt_3(motion_val + i, 1)) | 1190 | if(is_mv_diff_gt_3(motion_val + i, 1)) |
| @@ -1225,26 +1227,26 @@ static int rv34_decode_inter_macroblock(RV34DecContext *r, int8_t *intra_types) · 36 unmodified lines |
| 1225 | dist = (s->mb_x - s->resync_mb_x) + (s->mb_y - s->resync_mb_y) * s->mb_width; | 1227 | dist = (s->mb_x - s->resync_mb_x) + (s->mb_y - s->resync_mb_y) * s->mb_width; |
| 1226 | if(s->mb_x && dist) | 1228 | if(s->mb_x && dist) |
| 1227 | r->avail_cache[5] = | 1229 | r->avail_cache[5] = |
| 1228 | r->avail_cache[9] = s->cur_pic_ptr->mb_type[mb_pos - 1]; | 1230 | r->avail_cache[9] = s->cur_pic.mb_type[mb_pos - 1]; |
| 1229 | if(dist >= s->mb_width) | 1231 | if(dist >= s->mb_width) |
| 1230 | r->avail_cache[2] = | 1232 | r->avail_cache[2] = |
| 1231 | r->avail_cache[3] = s->cur_pic_ptr->mb_type[mb_pos - s->mb_stride]; | 1233 | r->avail_cache[3] = s->cur_pic.mb_type[mb_pos - s->mb_stride]; |
| 1232 | if(((s->mb_x+1) < s->mb_width) && dist >= s->mb_width - 1) | 1234 | if(((s->mb_x+1) < s->mb_width) && dist >= s->mb_width - 1) |
| 1233 | r->avail_cache[4] = s->cur_pic_ptr->mb_type[mb_pos - s->mb_stride + 1]; | 1235 | r->avail_cache[4] = s->cur_pic.mb_type[mb_pos - s->mb_stride + 1]; |
| 1234 | if(s->mb_x && dist > s->mb_width) | 1236 | if(s->mb_x && dist > s->mb_width) |
| 1235 | r->avail_cache[1] = s->cur_pic_ptr->mb_type[mb_pos - s->mb_stride - 1]; | 1237 | r->avail_cache[1] = s->cur_pic.mb_type[mb_pos - s->mb_stride - 1]; |
| 1236 | | 1238 | |
| 1237 | s->qscale = r->si.quant; | 1239 | s->qscale = r->si.quant; |
| 1238 | cbp = cbp2 = rv34_decode_inter_mb_header(r, intra_types); | 1240 | cbp = cbp2 = rv34_decode_inter_mb_header(r, intra_types); |
| 1239 | r->cbp_luma [mb_pos] = cbp; | 1241 | r->cbp_luma [mb_pos] = cbp; |
| 1240 | r->cbp_chroma[mb_pos] = cbp >> 16; | 1242 | r->cbp_chroma[mb_pos] = cbp >> 16; |
| 1241 | r->deblock_coefs[mb_pos] = rv34_set_deblock_coef(r) | r->cbp_luma[mb_pos]; | 1243 | r->deblock_coefs[mb_pos] = rv34_set_deblock_coef(r) | r->cbp_luma[mb_pos]; |
| 1242 | s->cur_pic_ptr->qscale_table[mb_pos] = s->qscale; | 1244 | s->cur_pic.qscale_table[mb_pos] = s->qscale; |
| 1243 | | 1245 | |
| 1244 | if(cbp == -1) | 1246 | if(cbp == -1) |
| 1245 | return -1; | 1247 | return -1; |
| 1246 | | 1248 | |
| 1247 | if (IS_INTRA(s->cur_pic_ptr->mb_type[mb_pos])){ | 1249 | if (IS_INTRA(s->cur_pic.mb_type[mb_pos])) { |
| 1248 | if(r->is16) rv34_output_i16x16(r, intra_types, cbp); | 1250 | if(r->is16) rv34_output_i16x16(r, intra_types, cbp); |
| 1249 | else rv34_output_intra(r, intra_types, cbp); | 1251 | else rv34_output_intra(r, intra_types, cbp); |
| 1250 | return 0; | 1252 | return 0; |
| @@ -1327,21 +1329,21 @@ static int rv34_decode_intra_macroblock(RV34DecContext *r, int8_t *intra_types) · 76 unmodified lines |
| 1327 | dist = (s->mb_x - s->resync_mb_x) + (s->mb_y - s->resync_mb_y) * s->mb_width; | 1329 | dist = (s->mb_x - s->resync_mb_x) + (s->mb_y - s->resync_mb_y) * s->mb_width; |
| 1328 | if(s->mb_x && dist) | 1330 | if(s->mb_x && dist) |
| 1329 | r->avail_cache[5] = | 1331 | r->avail_cache[5] = |
| 1330 | r->avail_cache[9] = s->cur_pic_ptr->mb_type[mb_pos - 1]; | 1332 | r->avail_cache[9] = s->cur_pic.mb_type[mb_pos - 1]; |
| 1331 | if(dist >= s->mb_width) | 1333 | if(dist >= s->mb_width) |
| 1332 | r->avail_cache[2] = | 1334 | r->avail_cache[2] = |
| 1333 | r->avail_cache[3] = s->cur_pic_ptr->mb_type[mb_pos - s->mb_stride]; | 1335 | r->avail_cache[3] = s->cur_pic.mb_type[mb_pos - s->mb_stride]; |
| 1334 | if(((s->mb_x+1) < s->mb_width) && dist >= s->mb_width - 1) | 1336 | if(((s->mb_x+1) < s->mb_width) && dist >= s->mb_width - 1) |
| 1335 | r->avail_cache[4] = s->cur_pic_ptr->mb_type[mb_pos - s->mb_stride + 1]; | 1337 | r->avail_cache[4] = s->cur_pic.mb_type[mb_pos - s->mb_stride + 1]; |
| 1336 | if(s->mb_x && dist > s->mb_width) | 1338 | if(s->mb_x && dist > s->mb_width) |
| 1337 | r->avail_cache[1] = s->cur_pic_ptr->mb_type[mb_pos - s->mb_stride - 1]; | 1339 | r->avail_cache[1] = s->cur_pic.mb_type[mb_pos - s->mb_stride - 1]; |
| 1338 | | 1340 | |
| 1339 | s->qscale = r->si.quant; | 1341 | s->qscale = r->si.quant; |
| 1340 | cbp = rv34_decode_intra_mb_header(r, intra_types); | 1342 | cbp = rv34_decode_intra_mb_header(r, intra_types); |
| 1341 | r->cbp_luma [mb_pos] = cbp; | 1343 | r->cbp_luma [mb_pos] = cbp; |
| 1342 | r->cbp_chroma[mb_pos] = cbp >> 16; | 1344 | r->cbp_chroma[mb_pos] = cbp >> 16; |
| 1343 | r->deblock_coefs[mb_pos] = 0xFFFF; | 1345 | r->deblock_coefs[mb_pos] = 0xFFFF; |
| 1344 | s->cur_pic_ptr->qscale_table[mb_pos] = s->qscale; | 1346 | s->cur_pic.qscale_table[mb_pos] = s->qscale; |
| 1345 | | 1347 | |
| 1346 | if(cbp == -1) | 1348 | if(cbp == -1) |
| 1347 | return -1; | 1349 | return -1; |