summaryrefslogtreecommitdiff
path: root/libavcodec/msmpeg4enc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-01-26 22:19:19 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-01-29 06:28:24 +0100
commitd8b2fae3c73d92608abeaa04402fd05266e29bb2 (patch)
tree816e346a00f7a6036b48dc444c2550172d066860 /libavcodec/msmpeg4enc.c
parentfbb81ea2c615b1189d21ea00127be205db36b342 (diff)
avcodec/msmpeg4: Inline number of motion vectors
Both motion vector tables have the same number of elements, hence one can inline said number and remove the field containing the number of elements from the structure. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/msmpeg4enc.c')
-rw-r--r--libavcodec/msmpeg4enc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/msmpeg4enc.c b/libavcodec/msmpeg4enc.c
index 2c61735d9d..5f809c2aeb 100644
--- a/libavcodec/msmpeg4enc.c
+++ b/libavcodec/msmpeg4enc.c
@@ -56,9 +56,9 @@ static av_cold int init_mv_table(MVTable *tab)
/* mark all entries as not used */
for(i=0;i<4096;i++)
- tab->table_mv_index[i] = tab->n;
+ tab->table_mv_index[i] = MSMPEG4_MV_TABLES_NB_ELEMS;
- for(i=0;i<tab->n;i++) {
+ for (i = 0; i < MSMPEG4_MV_TABLES_NB_ELEMS; i++) {
x = tab->table_mvx[i];
y = tab->table_mvy[i];
tab->table_mv_index[(x << 6) | y] = i;
@@ -320,7 +320,7 @@ void ff_msmpeg4_encode_motion(MpegEncContext * s,
put_bits(&s->pb,
mv->table_mv_bits[code],
mv->table_mv_code[code]);
- if (code == mv->n) {
+ if (code == MSMPEG4_MV_TABLES_NB_ELEMS) {
/* escape : code literally */
put_bits(&s->pb, 6, mx);
put_bits(&s->pb, 6, my);