History

avcodec/rv30, rv34, rv40: Avoid indirection

Use the cached values from MpegEncContext.(cur|last|next)_pic instead of the corresponding *_pic_ptr. Also do the same in wmv2dec.c and mpegvideo_enc.c.

Andreas Rheinhardt committed 3 years ago

Commit f1c4e891 parent 7814dd75 files · +80 −79Browse files

Showing the changes to libavcodec (5 of 5 files). Show all

Unified · Split

5 files
  1. libavcodec/mpegvideo_enc.c +1 −1
  2. libavcodec/rv30.c +9 −9
  3. libavcodec/rv34.c +62 −60
  4. libavcodec/rv40.c +5 −5
  5. libavcodec/wmv2dec.c +3 −4
libavcodec/mpegvideo_enc.c+1−1
@@ -2145,7 +2145,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, · 2144 unmodified lines
21452145 update_qscale(s);
21462146
21472147 if (!(s->mpv_flags & FF_MPV_FLAG_QP_RD)) {
2148− s->qscale = s->cur_pic_ptr->qscale_table[mb_xy];
2148+ s->qscale = s->cur_pic.qscale_table[mb_xy];
21492149 s->dquant = s->qscale - last_qp;
21502150
21512151 if (s->out_format == FMT_H263) {
libavcodec/rv30.c+9−9
@@ -160,7 +160,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row) · 159 unmodified lines
160160
161161 mb_pos = row * s->mb_stride;
162162 for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){
163− int mbtype = s->cur_pic_ptr->mb_type[mb_pos];
163+ int mbtype = s->cur_pic.mb_type[mb_pos];
164164 if(IS_INTRA(mbtype) || IS_SEPARATE_DC(mbtype))
165165 r->deblock_coefs[mb_pos] = 0xFFFF;
166166 if(IS_INTRA(mbtype))
@@ -172,11 +172,11 @@ static void rv30_loop_filter(RV34DecContext *r, int row) · 5 unmodified lines
172172 */
173173 mb_pos = row * s->mb_stride;
174174 for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){
175− cur_lim = rv30_loop_filt_lim[s->cur_pic_ptr->qscale_table[mb_pos]];
175+ cur_lim = rv30_loop_filt_lim[s->cur_pic.qscale_table[mb_pos]];
176176 if(mb_x)
177− left_lim = rv30_loop_filt_lim[s->cur_pic_ptr->qscale_table[mb_pos - 1]];
177+ left_lim = rv30_loop_filt_lim[s->cur_pic.qscale_table[mb_pos - 1]];
178178 for(j = 0; j < 16; j += 4){
179− Y = s->cur_pic_ptr->f->data[0] + mb_x*16 + (row*16 + j) * s->linesize + 4 * !mb_x;
179+ Y = s->cur_pic.data[0] + mb_x*16 + (row*16 + j) * s->linesize + 4 * !mb_x;
180180 for(i = !mb_x; i < 4; i++, Y += 4){
181181 int ij = i + j;
182182 loc_lim = 0;
@@ -196,7 +196,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row) · 13 unmodified lines
196196 if(mb_x)
197197 left_cbp = (r->cbp_chroma[mb_pos - 1] >> (k*4)) & 0xF;
198198 for(j = 0; j < 8; j += 4){
199− C = s->cur_pic_ptr->f->data[k + 1] + mb_x*8 + (row*8 + j) * s->uvlinesize + 4 * !mb_x;
199+ C = s->cur_pic.data[k + 1] + mb_x*8 + (row*8 + j) * s->uvlinesize + 4 * !mb_x;
200200 for(i = !mb_x; i < 2; i++, C += 4){
201201 int ij = i + (j >> 1);
202202 loc_lim = 0;
@@ -214,11 +214,11 @@ static void rv30_loop_filter(RV34DecContext *r, int row) · 11 unmodified lines
214214 }
215215 mb_pos = row * s->mb_stride;
216216 for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){
217− cur_lim = rv30_loop_filt_lim[s->cur_pic_ptr->qscale_table[mb_pos]];
217+ cur_lim = rv30_loop_filt_lim[s->cur_pic.qscale_table[mb_pos]];
218218 if(row)
219− top_lim = rv30_loop_filt_lim[s->cur_pic_ptr->qscale_table[mb_pos - s->mb_stride]];
219+ top_lim = rv30_loop_filt_lim[s->cur_pic.qscale_table[mb_pos - s->mb_stride]];
220220 for(j = 4*!row; j < 16; j += 4){
221− Y = s->cur_pic_ptr->f->data[0] + mb_x*16 + (row*16 + j) * s->linesize;
221+ Y = s->cur_pic.data[0] + mb_x*16 + (row*16 + j) * s->linesize;
222222 for(i = 0; i < 4; i++, Y += 4){
223223 int ij = i + j;
224224 loc_lim = 0;
@@ -238,7 +238,7 @@ static void rv30_loop_filter(RV34DecContext *r, int row) · 13 unmodified lines
238238 if(row)
239239 top_cbp = (r->cbp_chroma[mb_pos - s->mb_stride] >> (k*4)) & 0xF;
240240 for(j = 4*!row; j < 8; j += 4){
241− C = s->cur_pic_ptr->f->data[k+1] + mb_x*8 + (row*8 + j) * s->uvlinesize;
241+ C = s->cur_pic.data[k+1] + mb_x*8 + (row*8 + j) * s->uvlinesize;
242242 for(i = 0; i < 2; i++, C += 4){
243243 int ij = i + (j >> 1);
244244 loc_lim = 0;
libavcodec/rv34.c+62−60
@@ -369,7 +369,7 @@ static int rv34_decode_intra_mb_header(RV34DecContext *r, int8_t *intra_types) · 368 unmodified lines
369369
370370 r->is16 = get_bits1(gb);
371371 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;
373373 r->block_type = RV34_MB_TYPE_INTRA16x16;
374374 t = get_bits(gb, 2);
375375 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
379379 if(!get_bits1(gb))
380380 av_log(s->avctx, AV_LOG_ERROR, "Need DQUANT\n");
381381 }
382− s->cur_pic_ptr->mb_type[mb_pos] = MB_TYPE_INTRA;
382+ s->cur_pic.mb_type[mb_pos] = MB_TYPE_INTRA;
383383 r->block_type = RV34_MB_TYPE_INTRA;
384384 if(r->decode_intra_types(r, gb, intra_types) < 0)
385385 return -1;
@@ -405,7 +405,7 @@ static int rv34_decode_inter_mb_header(RV34DecContext *r, int8_t *intra_types) · 19 unmodified lines
405405 r->block_type = r->decode_mb_info(r);
406406 if(r->block_type == -1)
407407 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];
409409 r->mb_type[mb_pos] = r->block_type;
410410 if(r->block_type == RV34_MB_SKIP){
411411 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
413413 if(s->pict_type == AV_PICTURE_TYPE_B)
414414 r->mb_type[mb_pos] = RV34_MB_B_DIRECT;
415415 }
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]);
417417 if (rv34_decode_mv(r, r->block_type) < 0)
418418 return -1;
419419 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
423423 r->chroma_vlc = 1;
424424 r->luma_vlc = 0;
425425
426− if(IS_INTRA(s->cur_pic_ptr->mb_type[mb_pos])){
426+ if (IS_INTRA(s->cur_pic.mb_type[mb_pos])) {
427427 if(r->is16){
428428 t = get_bits(gb, 2);
429429 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
482482 int mx, my;
483483 int* avail = r->avail_cache + avail_indexes[subblock_no];
484484 int c_off = part_sizes_w[block_type];
485+ int16_t (*motion_val)[2] = s->cur_pic.motion_val[0];
485486
486487 mv_pos += (subblock_no & 1) + (subblock_no >> 1)*s->b8_stride;
487488 if(subblock_no == 3)
488489 c_off = -1;
489490
490491 if(avail[-1]){
491− A[0] = s->cur_pic_ptr->motion_val[0][mv_pos-1][0];
492− A[1] = s->cur_pic_ptr->motion_val[0][mv_pos-1][1];
492+ A[0] = motion_val[mv_pos-1][0];
493+ A[1] = motion_val[mv_pos-1][1];
493494 }
494495 if(avail[-4]){
495− B[0] = s->cur_pic_ptr->motion_val[0][mv_pos-s->b8_stride][0];
496− B[1] = s->cur_pic_ptr->motion_val[0][mv_pos-s->b8_stride][1];
496+ B[0] = motion_val[mv_pos-s->b8_stride][0];
497+ B[1] = motion_val[mv_pos-s->b8_stride][1];
497498 }else{
498499 B[0] = A[0];
499500 B[1] = A[1];
500501 }
501502 if(!avail[c_off-4]){
502503 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[1] = s->cur_pic_ptr->motion_val[0][mv_pos-s->b8_stride-1][1];
504+ C[0] = motion_val[mv_pos-s->b8_stride-1][0];
505+ C[1] = motion_val[mv_pos-s->b8_stride-1][1];
505506 }else{
506507 C[0] = A[0];
507508 C[1] = A[1];
508509 }
509510 }else{
510− C[0] = s->cur_pic_ptr->motion_val[0][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];
511+ C[0] = motion_val[mv_pos-s->b8_stride+c_off][0];
512+ C[1] = motion_val[mv_pos-s->b8_stride+c_off][1];
512513 }
513514 mx = mid_pred(A[0], B[0], C[0]);
514515 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
516517 my += r->dmv[dmv_no][1];
517518 for(j = 0; j < part_sizes_h[block_type]; j++){
518519 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− s->cur_pic_ptr->motion_val[0][mv_pos + i + j*s->b8_stride][1] = my;
520+ motion_val[mv_pos + i + j*s->b8_stride][0] = mx;
521+ motion_val[mv_pos + i + j*s->b8_stride][1] = my;
521522 }
522523 }
523524 }
@@ -566,7 +567,7 @@ static void rv34_pred_mv_b(RV34DecContext *r, int block_type, int dir) · 42 unmodified lines
566567 int has_A = 0, has_B = 0, has_C = 0;
567568 int mx, my;
568569 int i, j;
569− Picture *cur_pic = s->cur_pic_ptr;
570+ Picture *cur_pic = &s->cur_pic;
570571 const int mask = dir ? MB_TYPE_L1 : MB_TYPE_L0;
571572 int type = cur_pic->mb_type[mb_pos];
572573
@@ -619,27 +620,27 @@ static void rv34_pred_mv_rv3(RV34DecContext *r, int block_type, int dir) · 46 unmodified lines
619620 int* avail = r->avail_cache + avail_indexes[0];
620621
621622 if(avail[-1]){
622− A[0] = s->cur_pic_ptr->motion_val[0][mv_pos - 1][0];
623− A[1] = s->cur_pic_ptr->motion_val[0][mv_pos - 1][1];
623+ A[0] = s->cur_pic.motion_val[0][mv_pos - 1][0];
624+ A[1] = s->cur_pic.motion_val[0][mv_pos - 1][1];
624625 }
625626 if(avail[-4]){
626− B[0] = s->cur_pic_ptr->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];
627+ B[0] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride][0];
628+ B[1] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride][1];
628629 }else{
629630 B[0] = A[0];
630631 B[1] = A[1];
631632 }
632633 if(!avail[-4 + 2]){
633634 if(avail[-4] && (avail[-1])){
634− C[0] = s->cur_pic_ptr->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];
635+ C[0] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride - 1][0];
636+ C[1] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride - 1][1];
636637 }else{
637638 C[0] = A[0];
638639 C[1] = A[1];
639640 }
640641 }else{
641− C[0] = s->cur_pic_ptr->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];
642+ C[0] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride + 2][0];
643+ C[1] = s->cur_pic.motion_val[0][mv_pos - s->b8_stride + 2][1];
643644 }
644645 mx = mid_pred(A[0], B[0], C[0]);
645646 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
648649 for(j = 0; j < 2; j++){
649650 for(i = 0; i < 2; i++){
650651 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_ptr->motion_val[k][mv_pos + i + j*s->b8_stride][1] = my;
652+ s->cur_pic.motion_val[k][mv_pos + i + j*s->b8_stride][0] = mx;
653+ s->cur_pic.motion_val[k][mv_pos + i + j*s->b8_stride][1] = my;
653654 }
654655 }
655656 }
@@ -685,27 +686,28 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type, · 29 unmodified lines
685686 int mv_pos = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride + mv_off;
686687 int is16x16 = 1;
687688 int emu = 0;
689+ int16_t *motion_val = s->cur_pic.motion_val[dir][mv_pos];
688690
689691 if(thirdpel){
690692 int chroma_mx, chroma_my;
691− mx = (s->cur_pic_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) / 3 - (1 << 24);
692− my = (s->cur_pic_ptr->motion_val[dir][mv_pos][1] + (3 << 24)) / 3 - (1 << 24);
693− lx = (s->cur_pic_ptr->motion_val[dir][mv_pos][0] + (3 << 24)) % 3;
694− ly = (s->cur_pic_ptr->motion_val[dir][mv_pos][1] + (3 << 24)) % 3;
695− chroma_mx = s->cur_pic_ptr->motion_val[dir][mv_pos][0] / 2;
696− chroma_my = s->cur_pic_ptr->motion_val[dir][mv_pos][1] / 2;
693+ mx = (motion_val[0] + (3 << 24)) / 3 - (1 << 24);
694+ my = (motion_val[1] + (3 << 24)) / 3 - (1 << 24);
695+ lx = (motion_val[0] + (3 << 24)) % 3;
696+ ly = (motion_val[1] + (3 << 24)) % 3;
697+ chroma_mx = motion_val[0] / 2;
698+ chroma_my = motion_val[1] / 2;
697699 umx = (chroma_mx + (3 << 24)) / 3 - (1 << 24);
698700 umy = (chroma_my + (3 << 24)) / 3 - (1 << 24);
699701 uvmx = chroma_coeffs[(chroma_mx + (3 << 24)) % 3];
700702 uvmy = chroma_coeffs[(chroma_my + (3 << 24)) % 3];
701703 }else{
702704 int cx, cy;
703− mx = s->cur_pic_ptr->motion_val[dir][mv_pos][0] >> 2;
704− my = s->cur_pic_ptr->motion_val[dir][mv_pos][1] >> 2;
705− lx = s->cur_pic_ptr->motion_val[dir][mv_pos][0] & 3;
706− ly = s->cur_pic_ptr->motion_val[dir][mv_pos][1] & 3;
707− cx = s->cur_pic_ptr->motion_val[dir][mv_pos][0] / 2;
708− cy = s->cur_pic_ptr->motion_val[dir][mv_pos][1] / 2;
705+ mx = motion_val[0] >> 2;
706+ my = motion_val[1] >> 2;
707+ lx = motion_val[0] & 3;
708+ ly = motion_val[1] & 3;
709+ cx = motion_val[0] / 2;
710+ cy = motion_val[1] / 2;
709711 umx = cx >> 2;
710712 umy = cy >> 2;
711713 uvmx = (cx & 3) << 1;
@@ -723,9 +725,9 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type, · 11 unmodified lines
723725 }
724726
725727 dxy = ly*4 + lx;
726− srcY = dir ? s->next_pic_ptr->f->data[0] : s->last_pic_ptr->f->data[0];
727− srcU = dir ? s->next_pic_ptr->f->data[1] : s->last_pic_ptr->f->data[1];
728− srcV = dir ? s->next_pic_ptr->f->data[2] : s->last_pic_ptr->f->data[2];
728+ srcY = dir ? s->next_pic.data[0] : s->last_pic.data[0];
729+ srcU = dir ? s->next_pic.data[1] : s->last_pic.data[1];
730+ srcV = dir ? s->next_pic.data[2] : s->last_pic.data[2];
729731 src_x = s->mb_x * 16 + xoff + mx;
730732 src_y = s->mb_y * 16 + yoff + my;
731733 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
886888 switch(block_type){
887889 case RV34_MB_TYPE_INTRA:
888890 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);
890892 return 0;
891893 case RV34_MB_SKIP:
892894 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);
894896 rv34_mc_1mv (r, block_type, 0, 0, 0, 2, 2, 0);
895897 break;
896898 }
@@ -900,21 +902,21 @@ static int rv34_decode_mv(RV34DecContext *r, int block_type) · 3 unmodified lines
900902 if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME))
901903 ff_thread_await_progress(&s->next_pic_ptr->tf, FFMAX(0, s->mb_y-1), 0);
902904
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];
904906 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);
906− ZERO8x2(s->cur_pic_ptr->motion_val[1][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);
908+ ZERO8x2(s->cur_pic.motion_val[1][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride);
907909 }else
908910 for(j = 0; j < 2; j++)
909911 for(i = 0; i < 2; i++)
910912 for(k = 0; k < 2; k++)
911913 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]);
913915 if(!(IS_16X8(next_bt) || IS_8X16(next_bt) || IS_8X8(next_bt))) //we can use whole macroblock MC
914916 rv34_mc_2mv(r, block_type);
915917 else
916918 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);
918920 break;
919921 case RV34_MB_P_16x16:
920922 case RV34_MB_P_MIX16x16:
@@ -1182,7 +1184,7 @@ static int rv34_set_deblock_coef(RV34DecContext *r) · 261 unmodified lines
11821184 MpegEncContext *s = &r->s;
11831185 int hmvmask = 0, vmvmask = 0, i, j;
11841186 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];
11861188 for(j = 0; j < 16; j += 8){
11871189 for(i = 0; i < 2; i++){
11881190 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
12251227 dist = (s->mb_x - s->resync_mb_x) + (s->mb_y - s->resync_mb_y) * s->mb_width;
12261228 if(s->mb_x && dist)
12271229 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];
12291231 if(dist >= s->mb_width)
12301232 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];
12321234 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];
12341236 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];
12361238
12371239 s->qscale = r->si.quant;
12381240 cbp = cbp2 = rv34_decode_inter_mb_header(r, intra_types);
12391241 r->cbp_luma [mb_pos] = cbp;
12401242 r->cbp_chroma[mb_pos] = cbp >> 16;
12411243 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;
12431245
12441246 if(cbp == -1)
12451247 return -1;
12461248
1247− if (IS_INTRA(s->cur_pic_ptr->mb_type[mb_pos])){
1249+ if (IS_INTRA(s->cur_pic.mb_type[mb_pos])) {
12481250 if(r->is16) rv34_output_i16x16(r, intra_types, cbp);
12491251 else rv34_output_intra(r, intra_types, cbp);
12501252 return 0;
@@ -1327,21 +1329,21 @@ static int rv34_decode_intra_macroblock(RV34DecContext *r, int8_t *intra_types) · 76 unmodified lines
13271329 dist = (s->mb_x - s->resync_mb_x) + (s->mb_y - s->resync_mb_y) * s->mb_width;
13281330 if(s->mb_x && dist)
13291331 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];
13311333 if(dist >= s->mb_width)
13321334 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];
13341336 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];
13361338 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];
13381340
13391341 s->qscale = r->si.quant;
13401342 cbp = rv34_decode_intra_mb_header(r, intra_types);
13411343 r->cbp_luma [mb_pos] = cbp;
13421344 r->cbp_chroma[mb_pos] = cbp >> 16;
13431345 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;
13451347
13461348 if(cbp == -1)
13471349 return -1;
libavcodec/rv40.c+5−5
@@ -371,7 +371,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row) · 370 unmodified lines
371371
372372 mb_pos = row * s->mb_stride;
373373 for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){
374− int mbtype = s->cur_pic_ptr->mb_type[mb_pos];
374+ int mbtype = s->cur_pic.mb_type[mb_pos];
375375 if(IS_INTRA(mbtype) || IS_SEPARATE_DC(mbtype))
376376 r->cbp_luma [mb_pos] = r->deblock_coefs[mb_pos] = 0xFFFF;
377377 if(IS_INTRA(mbtype))
@@ -386,7 +386,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row) · 8 unmodified lines
386386 unsigned y_to_deblock;
387387 int c_to_deblock[2];
388388
389− q = s->cur_pic_ptr->qscale_table[mb_pos];
389+ q = s->cur_pic.qscale_table[mb_pos];
390390 alpha = rv40_alpha_tab[q];
391391 beta = rv40_beta_tab [q];
392392 betaY = betaC = beta * 3;
@@ -401,7 +401,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row) · 8 unmodified lines
401401 if(avail[i]){
402402 int pos = mb_pos + neighbour_offs_x[i] + neighbour_offs_y[i]*s->mb_stride;
403403 mvmasks[i] = r->deblock_coefs[pos];
404− mbtype [i] = s->cur_pic_ptr->mb_type[pos];
404+ mbtype [i] = s->cur_pic.mb_type[pos];
405405 cbp [i] = r->cbp_luma[pos];
406406 uvcbp[i][0] = r->cbp_chroma[pos] & 0xF;
407407 uvcbp[i][1] = r->cbp_chroma[pos] >> 4;
@@ -460,7 +460,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row) · 52 unmodified lines
460460 }
461461
462462 for(j = 0; j < 16; j += 4){
463− Y = s->cur_pic_ptr->f->data[0] + mb_x*16 + (row*16 + j) * s->linesize;
463+ Y = s->cur_pic.data[0] + mb_x*16 + (row*16 + j) * s->linesize;
464464 for(i = 0; i < 4; i++, Y += 4){
465465 int ij = i + j;
466466 int clip_cur = y_to_deblock & (MASK_CUR << ij) ? clip[POS_CUR] : 0;
@@ -505,7 +505,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row) · 38 unmodified lines
505505 }
506506 for(k = 0; k < 2; k++){
507507 for(j = 0; j < 2; j++){
508− C = s->cur_pic_ptr->f->data[k + 1] + mb_x*8 + (row*8 + j*4) * s->uvlinesize;
508+ C = s->cur_pic.data[k + 1] + mb_x*8 + (row*8 + j*4) * s->uvlinesize;
509509 for(i = 0; i < 2; i++, C += 4){
510510 int ij = i + j*2;
511511 int clip_cur = c_to_deblock[k] & (MASK_CUR << ij) ? clip[POS_CUR] : 0;
libavcodec/wmv2dec.c+3−4
@@ -103,7 +103,7 @@ static int parse_mb_skip(WMV2DecContext *w) · 102 unmodified lines
103103 int mb_x, mb_y;
104104 int coded_mb_count = 0;
105105 MpegEncContext *const s = &w->s;
106− uint32_t *const mb_type = s->cur_pic_ptr->mb_type;
106+ uint32_t *const mb_type = s->cur_pic.mb_type;
107107
108108 w->skip_type = get_bits(&s->gb, 2);
109109 switch (w->skip_type) {
@@ -238,9 +238,8 @@ int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s) · 128 unmodified lines
238238
239239 if (s->pict_type == AV_PICTURE_TYPE_I) {
240240 /* Is filling with zeroes really the right thing to do? */
241− memset(s->cur_pic_ptr->mb_type, 0,
242− sizeof(*s->cur_pic_ptr->mb_type) *
243− s->mb_height * s->mb_stride);
241+ memset(s->cur_pic.mb_type, 0,
242+ sizeof(*s->cur_pic.mb_type) * s->mb_height * s->mb_stride);
244243 if (w->j_type_bit)
245244 w->j_type = get_bits1(&s->gb);
246245 else

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t