Commit 567616c1 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '8a776ad9'

* commit '8a776ad9':
  h261: Move shared data tables from a header to a proper C file

Conflicts:
	libavcodec/Makefile
	libavcodec/h261data.c
	libavcodec/h261dec.c
	libavcodec/h261enc.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 38d1a5a2 8a776ad9
......@@ -213,8 +213,8 @@ OBJS-$(CONFIG_GIF_DECODER) += gifdec.o lzw.o
OBJS-$(CONFIG_GIF_ENCODER) += gif.o lzwenc.o
OBJS-$(CONFIG_GSM_DECODER) += gsmdec.o gsmdec_data.o msgsmdec.o
OBJS-$(CONFIG_GSM_MS_DECODER) += gsmdec.o gsmdec_data.o msgsmdec.o
OBJS-$(CONFIG_H261_DECODER) += h261dec.o h261.o h261data.o
OBJS-$(CONFIG_H261_ENCODER) += h261enc.o h261.o h261data.o
OBJS-$(CONFIG_H261_DECODER) += h261dec.o h261data.o h261.o
OBJS-$(CONFIG_H261_ENCODER) += h261enc.o h261data.o h261.o
OBJS-$(CONFIG_H263_DECODER) += h263dec.o h263.o ituh263dec.o \
mpeg4video.o mpeg4videodec.o flvdec.o\
intelh263dec.o
......
......@@ -29,6 +29,7 @@
#define AVCODEC_H261_H
#include "mpegvideo.h"
#include "rl.h"
/**
* H261Context
......@@ -50,6 +51,15 @@ typedef struct H261Context {
extern uint8_t ff_h261_rl_table_store[2][2 * MAX_RUN + MAX_LEVEL + 3];
extern const uint8_t ff_h261_mba_code[35];
extern const uint8_t ff_h261_mba_bits[35];
extern const uint8_t ff_h261_mtype_code[10];
extern const uint8_t ff_h261_mtype_bits[10];
extern const int ff_h261_mtype_map[10];
extern const uint8_t ff_h261_mv_tab[17][2];
extern const uint8_t ff_h261_cbp_tab[63][2];
extern RLTable ff_h261_rl_tcoeff;
void ff_h261_loop_filter(MpegEncContext *s);
int ff_h261_get_picture_format(int width, int height);
......
......@@ -25,9 +25,9 @@
*/
#include <stdint.h>
#include "h261.h"
#include "h261data.h"
#include "rl.h"
#include "h261.h"
// H.261 VLC table for macroblock addressing
const uint8_t ff_h261_mba_code[35] = {
......
/*
* copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
* copyright (c) 2004 Maarten Daniels
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* H.261 tables.
*/
#ifndef AVCODEC_H261DATA_H
#define AVCODEC_H261DATA_H
#include <stdint.h>
#include "h261.h"
extern const uint8_t ff_h261_mba_code[35];
extern const uint8_t ff_h261_mba_bits[35];
extern const uint8_t ff_h261_mtype_code[10];
extern const uint8_t ff_h261_mtype_bits[10];
extern const int ff_h261_mtype_map[10];
extern const uint8_t ff_h261_mv_tab[17][2];
extern const uint8_t ff_h261_cbp_tab[63][2];
extern RLTable ff_h261_rl_tcoeff;
#endif /* AVCODEC_H261DATA_H */
......@@ -30,7 +30,6 @@
#include "mpegvideo.h"
#include "h263.h"
#include "h261.h"
#include "h261data.h"
#define H261_MBA_VLC_BITS 9
#define H261_MTYPE_VLC_BITS 6
......
......@@ -30,7 +30,6 @@
#include "mpegvideo.h"
#include "h263.h"
#include "h261.h"
#include "h261data.h"
int ff_h261_get_picture_format(int width, int height)
{
......@@ -254,7 +253,8 @@ void ff_h261_encode_mb(MpegEncContext *s, int16_t block[6][64],
}
/* MB is not skipped, encode MBA */
put_bits(&s->pb, ff_h261_mba_bits[(h->current_mba - h->previous_mba) - 1],
put_bits(&s->pb,
ff_h261_mba_bits[(h->current_mba - h->previous_mba) - 1],
ff_h261_mba_code[(h->current_mba - h->previous_mba) - 1]);
/* calculate MTYPE */
......@@ -273,7 +273,9 @@ void ff_h261_encode_mb(MpegEncContext *s, int16_t block[6][64],
if (s->dquant)
h->mtype++;
put_bits(&s->pb, ff_h261_mtype_bits[h->mtype], ff_h261_mtype_code[h->mtype]);
put_bits(&s->pb,
ff_h261_mtype_bits[h->mtype],
ff_h261_mtype_code[h->mtype]);
h->mtype = ff_h261_mtype_map[h->mtype];
......@@ -295,7 +297,9 @@ void ff_h261_encode_mb(MpegEncContext *s, int16_t block[6][64],
if (HAS_CBP(h->mtype)) {
av_assert1(cbp > 0);
put_bits(&s->pb, ff_h261_cbp_tab[cbp - 1][1], ff_h261_cbp_tab[cbp - 1][0]);
put_bits(&s->pb,
ff_h261_cbp_tab[cbp - 1][1],
ff_h261_cbp_tab[cbp - 1][0]);
}
for (i = 0; i < 6; i++)
/* encode each block */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment