---
libavcodec/error_resilience.c | 16 ++++++++--------
libavcodec/h263.c | 8 ++++----
libavcodec/h264.c | 16 ++++++++--------
libavcodec/h264.h | 4 ++--
libavcodec/h264_direct.c | 8 ++++----
libavcodec/h264_mvpred.h | 6 +++---
libavcodec/mpeg12.c | 4 ++--
libavcodec/mpeg4video.c | 2 +-
libavcodec/mpegvideo.c | 6 +++---
libavcodec/mpegvideo.h | 1 +
libavcodec/svq3.c | 6 +++---
11 files changed, 39 insertions(+), 38 deletions(-)
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index e64b2e0..03eef29 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -462,7 +462,7 @@ static void guess_mv(ERContext *s)
mv_predictor[pred_count][1] =
s->cur_pic->motion_val[0][mot_index - mot_step][1];
ref[pred_count] =
- s->cur_pic->f.ref_index[0][4 * (mb_xy - 1)];
+ s->cur_pic->ref_index[0][4 * (mb_xy - 1)];
pred_count++;
}
if (mb_x + 1 < mb_width && fixed[mb_xy + 1]) {
@@ -471,7 +471,7 @@ static void guess_mv(ERContext *s)
mv_predictor[pred_count][1] =
s->cur_pic->motion_val[0][mot_index + mot_step][1];
ref[pred_count] =
- s->cur_pic->f.ref_index[0][4 * (mb_xy + 1)];
+ s->cur_pic->ref_index[0][4 * (mb_xy + 1)];
pred_count++;
}
if (mb_y > 0 && fixed[mb_xy - mb_stride]) {
@@ -480,7 +480,7 @@ static void guess_mv(ERContext *s)
mv_predictor[pred_count][1] =
s->cur_pic->motion_val[0][mot_index - mot_stride *
mot_step][1];
ref[pred_count] =
- s->cur_pic->f.ref_index[0][4 * (mb_xy -
s->mb_stride)];
+ s->cur_pic->ref_index[0][4 * (mb_xy -
s->mb_stride)];
pred_count++;
}
if (mb_y + 1<mb_height && fixed[mb_xy + mb_stride]) {
@@ -489,7 +489,7 @@ static void guess_mv(ERContext *s)
mv_predictor[pred_count][1] =
s->cur_pic->motion_val[0][mot_index + mot_stride *
mot_step][1];
ref[pred_count] =
- s->cur_pic->f.ref_index[0][4 * (mb_xy +
s->mb_stride)];
+ s->cur_pic->ref_index[0][4 * (mb_xy +
s->mb_stride)];
pred_count++;
}
if (pred_count == 0)
@@ -551,15 +551,15 @@ skip_mean_and_median:
mb_y, 0);
}
if (!s->last_pic->motion_val[0] ||
- !s->last_pic->f.ref_index[0])
+ !s->last_pic->ref_index[0])
goto skip_last_mv;
prev_x = s->last_pic->motion_val[0][mot_index][0];
prev_y = s->last_pic->motion_val[0][mot_index][1];
- prev_ref = s->last_pic->f.ref_index[0][4 * mb_xy];
+ prev_ref = s->last_pic->ref_index[0][4 * mb_xy];
} else {
prev_x = s->cur_pic->motion_val[0][mot_index][0];
prev_y = s->cur_pic->motion_val[0][mot_index][1];
- prev_ref = s->cur_pic->f.ref_index[0][4 * mb_xy];
+ prev_ref = s->cur_pic->ref_index[0][4 * mb_xy];
}
/* last MV */
@@ -835,7 +835,7 @@ void ff_er_frame_end(ERContext *s)
av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n");
for (i = 0; i < 2; i++) {
- s->cur_pic->f.ref_index[i] = av_mallocz(s->mb_stride *
s->mb_height * 4 * sizeof(uint8_t));
+ s->cur_pic->ref_index[i ] = av_mallocz(s->mb_stride *
s->mb_height * 4 * sizeof(uint8_t));
s->cur_pic->motion_val_base[i] = av_mallocz((size + 4) * 2 *
sizeof(uint16_t));
s->cur_pic->motion_val[i] = s->cur_pic->motion_val_base[i] + 4;
}
diff --git a/libavcodec/h263.c b/libavcodec/h263.c
index 612cb94..c097033 100644
--- a/libavcodec/h263.c
+++ b/libavcodec/h263.c
@@ -70,10 +70,10 @@ void ff_h263_update_motion_val(MpegEncContext * s){
s->p_field_mv_table[i][0][mb_xy][0]= s->mv[0][i][0];
s->p_field_mv_table[i][0][mb_xy][1]= s->mv[0][i][1];
}
- s->current_picture.f.ref_index[0][4*mb_xy ] =
- s->current_picture.f.ref_index[0][4*mb_xy + 1] =
s->field_select[0][0];
- s->current_picture.f.ref_index[0][4*mb_xy + 2] =
- s->current_picture.f.ref_index[0][4*mb_xy + 3] =
s->field_select[0][1];
+ s->current_picture.ref_index[0][4*mb_xy ] =
+ s->current_picture.ref_index[0][4*mb_xy + 1] =
s->field_select[0][0];
+ s->current_picture.ref_index[0][4*mb_xy + 2] =
+ s->current_picture.ref_index[0][4*mb_xy + 3] =
s->field_select[0][1];
}
/* no update if 8X8 because it has been done during parsing */
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 4358798..ca73e43 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -95,7 +95,7 @@ static void h264_er_decode_mb(void *opaque, int ref, int
mv_dir, int mv_type,
* practice then correct remapping should be added. */
if (ref >= h->ref_count[0])
ref = 0;
- fill_rectangle(&h->cur_pic.f.ref_index[0][4 * h->mb_xy],
+ fill_rectangle(&h->cur_pic.ref_index[0][4 * h->mb_xy],
2, 2, 2, ref, 1);
fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, ref, 1);
fill_rectangle(h->mv_cache[0][scan8[0]], 4, 4, 8,
@@ -131,7 +131,7 @@ static void free_picture(H264Context *h, Picture *pic)
pic->mb_type = NULL;
for (i = 0; i < 2; i++) {
av_freep(&pic->motion_val_base[i]);
- av_freep(&pic->f.ref_index[i]);
+ av_freep(&pic->ref_index[i]);
pic->motion_val[i] = NULL;
}
}
@@ -216,7 +216,7 @@ static int alloc_picture(H264Context *h, Picture *pic)
2 * (b4_array_size + 4) * sizeof(int16_t),
fail)
pic->motion_val[i] = pic->motion_val_base[i] + 4;
- FF_ALLOCZ_OR_GOTO(h->avctx, pic->f.ref_index[i],
+ FF_ALLOCZ_OR_GOTO(h->avctx, pic->ref_index[i],
4 * mb_array_size * sizeof(uint8_t), fail)
}
pic->f.motion_subsample_log2 = 2;
@@ -3633,9 +3633,9 @@ static av_always_inline void
fill_filter_caches_inter(H264Context *h,
int (*ref2frm)[64] = h->ref2frm[h->slice_table[top_xy] &
(MAX_SLICES - 1)][0] + (MB_MBAFF ? 20 : 2);
AV_COPY128(mv_dst - 1 * 8, h->cur_pic.motion_val[list][b_xy + 0]);
ref_cache[0 - 1 * 8] =
- ref_cache[1 - 1 * 8] =
ref2frm[list][h->cur_pic.f.ref_index[list][b8_xy + 0]];
+ ref_cache[1 - 1 * 8] =
ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 0]];
ref_cache[2 - 1 * 8] =
- ref_cache[3 - 1 * 8] =
ref2frm[list][h->cur_pic.f.ref_index[list][b8_xy + 1]];
+ ref_cache[3 - 1 * 8] =
ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 1]];
} else {
AV_ZERO128(mv_dst - 1 * 8);
AV_WN32A(&ref_cache[0 - 1 * 8], ((LIST_NOT_USED) & 0xFF) *
0x01010101u);
@@ -3651,9 +3651,9 @@ static av_always_inline void
fill_filter_caches_inter(H264Context *h,
AV_COPY32(mv_dst - 1 + 16, h->cur_pic.motion_val[list][b_xy +
b_stride * 2]);
AV_COPY32(mv_dst - 1 + 24, h->cur_pic.motion_val[list][b_xy +
b_stride * 3]);
ref_cache[-1 + 0] =
- ref_cache[-1 + 8] =
ref2frm[list][h->cur_pic.f.ref_index[list][b8_xy + 2 * 0]];
+ ref_cache[-1 + 8] =
ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 2 * 0]];
ref_cache[-1 + 16] =
- ref_cache[-1 + 24] =
ref2frm[list][h->cur_pic.f.ref_index[list][b8_xy + 2 * 1]];
+ ref_cache[-1 + 24] =
ref2frm[list][h->cur_pic.ref_index[list][b8_xy + 2 * 1]];
} else {
AV_ZERO32(mv_dst - 1 + 0);
AV_ZERO32(mv_dst - 1 + 8);
@@ -3677,7 +3677,7 @@ static av_always_inline void
fill_filter_caches_inter(H264Context *h,
}
{
- int8_t *ref = &h->cur_pic.f.ref_index[list][4 * mb_xy];
+ int8_t *ref = &h->cur_pic.ref_index[list][4 * mb_xy];
int (*ref2frm)[64] = h->ref2frm[h->slice_num & (MAX_SLICES - 1)][0] +
(MB_MBAFF ? 20 : 2);
uint32_t ref01 = (pack16to32(ref2frm[list][ref[0]],
ref2frm[list][ref[1]]) & 0x00FF00FF) * 0x0101;
uint32_t ref23 = (pack16to32(ref2frm[list][ref[2]],
ref2frm[list][ref[3]]) & 0x00FF00FF) * 0x0101;
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 08c2616..22b8357 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -896,7 +896,7 @@ static av_always_inline void
write_back_motion_list(H264Context *h,
}
{
- int8_t *ref_index = &h->cur_pic.f.ref_index[list][b8_xy];
+ int8_t *ref_index = &h->cur_pic.ref_index[list][b8_xy];
int8_t *ref_cache = h->ref_cache[list];
ref_index[0 + 0 * 2] = ref_cache[scan8[0]];
ref_index[1 + 0 * 2] = ref_cache[scan8[4]];
@@ -914,7 +914,7 @@ static av_always_inline void write_back_motion(H264Context
*h, int mb_type)
if (USES_LIST(mb_type, 0)) {
write_back_motion_list(h, b_stride, b_xy, b8_xy, mb_type, 0);
} else {
- fill_rectangle(&h->cur_pic.f.ref_index[0][b8_xy],
+ fill_rectangle(&h->cur_pic.ref_index[0][b8_xy],
2, 2, 2, (uint8_t)LIST_NOT_USED, 1);
}
if (USES_LIST(mb_type, 1))
diff --git a/libavcodec/h264_direct.c b/libavcodec/h264_direct.c
index 45c0e0b..d7d826a 100644
--- a/libavcodec/h264_direct.c
+++ b/libavcodec/h264_direct.c
@@ -290,8 +290,8 @@ single_col:
l1mv0 = &h->ref_list[1][0].motion_val[0][h->mb2b_xy [mb_xy]];
l1mv1 = &h->ref_list[1][0].motion_val[1][h->mb2b_xy [mb_xy]];
- l1ref0 = &h->ref_list[1][0].f.ref_index [0][4 * mb_xy];
- l1ref1 = &h->ref_list[1][0].f.ref_index [1][4 * mb_xy];
+ l1ref0 = &h->ref_list[1][0].ref_index [0][4 * mb_xy];
+ l1ref1 = &h->ref_list[1][0].ref_index [1][4 * mb_xy];
if(!b8_stride){
if(h->mb_y&1){
l1ref0 += 2;
@@ -480,8 +480,8 @@ single_col:
l1mv0 = &h->ref_list[1][0].motion_val[0][h->mb2b_xy [mb_xy]];
l1mv1 = &h->ref_list[1][0].motion_val[1][h->mb2b_xy [mb_xy]];
- l1ref0 = &h->ref_list[1][0].f.ref_index [0][4 * mb_xy];
- l1ref1 = &h->ref_list[1][0].f.ref_index [1][4 * mb_xy];
+ l1ref0 = &h->ref_list[1][0].ref_index [0][4 * mb_xy];
+ l1ref1 = &h->ref_list[1][0].ref_index [1][4 * mb_xy];
if(!b8_stride){
if(h->mb_y&1){
l1ref0 += 2;
diff --git a/libavcodec/h264_mvpred.h b/libavcodec/h264_mvpred.h
index 8a176e1..a61ad20 100644
--- a/libavcodec/h264_mvpred.h
+++ b/libavcodec/h264_mvpred.h
@@ -51,7 +51,7 @@ static av_always_inline int fetch_diagonal_mv(H264Context *h,
const int16_t **C,
mv = h->cur_pic_ptr->motion_val[list][h->mb2b_xy[xy] + 3 + y4 *
h->b_stride]; \
h->mv_cache[list][scan8[0] - 2][0] = mv[0]; \
h->mv_cache[list][scan8[0] - 2][1] = mv[1] MV_OP; \
- return h->cur_pic_ptr->f.ref_index[list][4 * xy + 1 + (y4 & ~1)]
REF_OP;
+ return h->cur_pic_ptr->ref_index[list][4 * xy + 1 + (y4 & ~1)] REF_OP;
if (topright_ref == PART_NOT_AVAILABLE
&& i >= scan8[0] + 8 && (i & 7) == 4
@@ -253,7 +253,7 @@ static av_always_inline void pred_pskip_motion(H264Context
*const h)
{
DECLARE_ALIGNED(4, static const int16_t, zeromv)[2] = { 0 };
DECLARE_ALIGNED(4, int16_t, mvbuf)[3][2];
- int8_t *ref = h->cur_pic.f.ref_index[0];
+ int8_t *ref = h->cur_pic.ref_index[0];
int16_t(*mv)[2] = h->cur_pic.motion_val[0];
int top_ref, left_ref, diagonal_ref, match_count, mx, my;
const int16_t *A, *B, *C;
@@ -602,7 +602,7 @@ static void fill_decode_caches(H264Context *h, int mb_type)
int b_stride = h->b_stride;
for (list = 0; list < h->list_count; list++) {
int8_t *ref_cache = &h->ref_cache[list][scan8[0]];
- int8_t *ref = h->cur_pic.f.ref_index[list];
+ int8_t *ref = h->cur_pic.ref_index[list];
int16_t(*mv_cache)[2] = &h->mv_cache[list][scan8[0]];
int16_t(*mv)[2] = h->cur_pic.motion_val[list];
if (!USES_LIST(mb_type, list))
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index fd29733..4d1889f 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1744,8 +1744,8 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
s->current_picture.motion_val[dir][xy ][1] = motion_y;
s->current_picture.motion_val[dir][xy + 1][0] = motion_x;
s->current_picture.motion_val[dir][xy + 1][1] = motion_y;
- s->current_picture.f.ref_index [dir][b8_xy ] =
- s->current_picture.f.ref_index [dir][b8_xy + 1] =
s->field_select[dir][i];
+ s->current_picture.ref_index [dir][b8_xy ] =
+ s->current_picture.ref_index [dir][b8_xy + 1] =
s->field_select[dir][i];
assert(s->field_select[dir][i] == 0 ||
s->field_select[dir][i] == 1);
}
xy += wrap;
diff --git a/libavcodec/mpeg4video.c b/libavcodec/mpeg4video.c
index 144ef9f..628ca67 100644
--- a/libavcodec/mpeg4video.c
+++ b/libavcodec/mpeg4video.c
@@ -137,7 +137,7 @@ int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int
my){
} else if(IS_INTERLACED(colocated_mb_type)){
s->mv_type = MV_TYPE_FIELD;
for(i=0; i<2; i++){
- int field_select = s->next_picture.f.ref_index[0][4 * mb_index + 2
* i];
+ int field_select = s->next_picture.ref_index[0][4 * mb_index + 2 *
i];
s->field_select[0][i]= field_select;
s->field_select[1][i]= i;
if(s->top_field_first){
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index ebd58db..1c04628 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -411,7 +411,7 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int
shared)
2 * (b4_array_size + 4) * sizeof(int16_t),
fail)
pic->motion_val[i] = pic->motion_val_base[i] + 4;
- FF_ALLOCZ_OR_GOTO(s->avctx, pic->f.ref_index[i],
+ FF_ALLOCZ_OR_GOTO(s->avctx, pic->ref_index[i],
4 * mb_array_size * sizeof(uint8_t), fail)
}
pic->f.motion_subsample_log2 = 2;
@@ -422,7 +422,7 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int
shared)
2 * (b8_array_size + 4) * sizeof(int16_t),
fail)
pic->motion_val[i] = pic->motion_val_base[i] + 4;
- FF_ALLOCZ_OR_GOTO(s->avctx, pic->f.ref_index[i],
+ FF_ALLOCZ_OR_GOTO(s->avctx, pic->ref_index[i],
4 * mb_array_size * sizeof(uint8_t), fail)
}
pic->f.motion_subsample_log2 = 3;
@@ -463,7 +463,7 @@ static void free_picture(MpegEncContext *s, Picture *pic)
pic->mb_type = NULL;
for (i = 0; i < 2; i++) {
av_freep(&pic->motion_val_base[i]);
- av_freep(&pic->f.ref_index[i]);
+ av_freep(&pic->ref_index[i]);
pic->motion_val[i] = NULL;
}
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 6809bda..bc919a9 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -154,6 +154,7 @@ typedef struct Picture{
uint8_t *mbskip_table;
int16_t (*motion_val[2])[2];
uint32_t *mb_type;
+ int8_t *ref_index[2];
} Picture;
/**
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 742ded2..ed8432a 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -1036,8 +1036,8 @@ static int get_buffer(AVCodecContext *avctx, Picture *pic)
for (i = 0; i < 2; i++) {
pic->motion_val_base[i] = av_mallocz(2 * (b4_array_size + 4) *
sizeof(int16_t));
- pic->f.ref_index[i] = av_mallocz(4 * mb_array_size);
- if (!pic->motion_val_base[i] || !pic->f.ref_index[i])
+ pic->ref_index[i] = av_mallocz(4 * mb_array_size);
+ if (!pic->motion_val_base[i] || !pic->ref_index[i])
return AVERROR(ENOMEM);
pic->motion_val[i] = pic->motion_val_base[i] + 4;
@@ -1253,7 +1253,7 @@ static void free_picture(AVCodecContext *avctx, Picture
*pic)
int i;
for (i = 0; i < 2; i++) {
av_freep(&pic->motion_val_base[i]);
- av_freep(&pic->f.ref_index[i]);
+ av_freep(&pic->ref_index[i]);
}
av_freep(&pic->mb_type_base);
--
1.7.10.4
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel