avcodec/mpeg4video: Split off data in a header of its own

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-01-09 11:18:09 +01:00
parent 8b9ef5a516
commit c21433c953
9 changed files with 69 additions and 40 deletions

View File

@ -39,7 +39,6 @@
#include "mathops.h"
#include "mpegutils.h"
#include "flv.h"
#include "mpeg4video.h"
#include "internal.h"
/**

View File

@ -28,8 +28,7 @@
#ifndef AVCODEC_MPEG4DATA_H
#define AVCODEC_MPEG4DATA_H
#include <stdint.h>
#include "mpegvideo.h"
#include "mpeg4videodata.h"
/* dc encoding for MPEG-4 */
const uint8_t ff_mpeg4_DCtab_lum[13][2] =

View File

@ -27,7 +27,6 @@
#include "get_bits.h"
#include "mpegvideo.h"
#include "rl.h"
// shapes
#define RECT_SHAPE 0
@ -118,40 +117,6 @@ typedef struct Mpeg4DecContext {
int rgb;
} Mpeg4DecContext;
static const uint8_t mpeg4_block_count[4] = {0, 6, 8, 12};
/* dc encoding for MPEG-4 */
extern const uint8_t ff_mpeg4_DCtab_lum[13][2];
extern const uint8_t ff_mpeg4_DCtab_chrom[13][2];
extern const uint16_t ff_mpeg4_intra_vlc[103][2];
extern const int8_t ff_mpeg4_intra_level[102];
extern const int8_t ff_mpeg4_intra_run[102];
extern RLTable ff_mpeg4_rl_intra;
void ff_mpeg4_init_rl_intra(void);
/* Note this is identical to the intra rvlc except that it is reordered. */
extern RLTable ff_rvlc_rl_inter;
extern RLTable ff_rvlc_rl_intra;
extern const uint8_t ff_sprite_trajectory_lens[15];
extern const uint8_t ff_mb_type_b_tab[4][2];
/* these matrixes will be permuted for the idct */
extern const int16_t ff_mpeg4_default_intra_matrix[64];
extern const int16_t ff_mpeg4_default_non_intra_matrix[64];
extern const uint8_t ff_mpeg4_y_dc_scale_table[32];
extern const uint8_t ff_mpeg4_c_dc_scale_table[32];
extern const uint16_t ff_mpeg4_resync_prefix[8];
extern const uint8_t ff_mpeg4_dc_threshold[8];
extern const uint8_t ff_mpeg4_studio_dc_luma[19][2];
extern const uint8_t ff_mpeg4_studio_dc_chroma[19][2];
extern const uint8_t ff_mpeg4_studio_intra[12][24][2];
void ff_mpeg4_encode_mb(MpegEncContext *s,
int16_t block[6][64],
int motion_x, int motion_y);

View File

@ -0,0 +1,61 @@
/*
* MPEG-4 encoder/decoder data.
* Copyright (c) 2000,2001 Fabrice Bellard
* Copyright (c) 2002-2010 Michael Niedermayer <michaelni@gmx.at>
*
* 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
*/
#ifndef AVCODEC_MPEG4VIDEODATA_H
#define AVCODEC_MPEG4VIDEODATA_H
#include <stdint.h>
#include "rl.h"
/* dc encoding for MPEG-4 */
extern const uint8_t ff_mpeg4_DCtab_lum[13][2];
extern const uint8_t ff_mpeg4_DCtab_chrom[13][2];
extern const uint16_t ff_mpeg4_intra_vlc[103][2];
extern const int8_t ff_mpeg4_intra_level[102];
extern const int8_t ff_mpeg4_intra_run[102];
extern RLTable ff_mpeg4_rl_intra;
void ff_mpeg4_init_rl_intra(void);
/* Note this is identical to the intra rvlc except that it is reordered. */
extern RLTable ff_rvlc_rl_inter;
extern RLTable ff_rvlc_rl_intra;
extern const uint8_t ff_sprite_trajectory_lens[15];
extern const uint8_t ff_mb_type_b_tab[4][2];
/* these matrixes will be permuted for the idct */
extern const int16_t ff_mpeg4_default_intra_matrix[64];
extern const int16_t ff_mpeg4_default_non_intra_matrix[64];
extern const uint8_t ff_mpeg4_y_dc_scale_table[32];
extern const uint8_t ff_mpeg4_c_dc_scale_table[32];
extern const uint16_t ff_mpeg4_resync_prefix[8];
extern const uint8_t ff_mpeg4_dc_threshold[8];
extern const uint8_t ff_mpeg4_studio_dc_luma[19][2];
extern const uint8_t ff_mpeg4_studio_dc_chroma[19][2];
extern const uint8_t ff_mpeg4_studio_intra[12][24][2];
#endif /* AVCODEC_MPEG4VIDEO_H */

View File

@ -34,6 +34,7 @@
#include "mpegvideo.h"
#include "mpegvideodata.h"
#include "mpeg4video.h"
#include "mpeg4videodata.h"
#include "h263.h"
#include "profiles.h"
#include "thread.h"
@ -56,6 +57,8 @@ static VLC studio_intra_tab[12];
static VLC studio_luma_dc;
static VLC studio_chroma_dc;
static const uint8_t mpeg4_block_count[4] = { 0, 6, 8, 12 };
static const int mb_type_b_map[4] = {
MB_TYPE_DIRECT2 | MB_TYPE_L0L1,
MB_TYPE_L0L1 | MB_TYPE_16x16,

View File

@ -28,6 +28,7 @@
#include "mpegvideo.h"
#include "h263.h"
#include "mpeg4video.h"
#include "mpeg4videodata.h"
#include "profiles.h"
/* The uni_DCtab_* tables below contain unified bits+length tables to encode DC

View File

@ -64,6 +64,7 @@
#include "aandcttab.h"
#include "flv.h"
#include "mpeg4video.h"
#include "mpeg4videodata.h"
#include "internal.h"
#include "bytestream.h"
#include "wmv2.h"

View File

@ -34,7 +34,7 @@
#include "mpegvideo.h"
#include "msmpeg4.h"
#include "libavutil/x86/asm.h"
#include "mpeg4video.h"
#include "mpeg4videodata.h"
#include "msmpeg4data.h"
#include "mpegvideodata.h"
#include "vc1data.h"

View File

@ -28,7 +28,7 @@
*/
#include "h263data.h"
#include "mpeg4video.h"
#include "mpeg4videodata.h"
#include "msmpeg4data.h"
uint32_t ff_v2_dc_lum_table[512][2];