aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/msmpeg4enc.h
blob: 98044913b1633e28388efc1ba99f9aca92139bc8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
 * MSMPEG4 encoder header
 * copyright (c) 2007 Aurelien Jacobs <aurel@gnuage.org>
 *
 * 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_MSMPEG4ENC_H
#define AVCODEC_MSMPEG4ENC_H

#include "config.h"
#include "mpegvideo.h"
#include "put_bits.h"
#include "rl.h"

typedef struct MSMPEG4EncContext {
    MpegEncContext s;

    /** [mb_intra][isChroma][level][run][last] */
    unsigned ac_stats[2][2][MAX_LEVEL + 1][MAX_RUN + 1][2];
} MSMPEG4EncContext;

void ff_msmpeg4_encode_init(MpegEncContext *s);
void ff_msmpeg4_encode_picture_header(MpegEncContext *s, int picture_number);
void ff_msmpeg4_encode_ext_header(MpegEncContext *s);
void ff_msmpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64],
                          int motion_x, int motion_y);
void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n);
void ff_msmpeg4_handle_slices(MpegEncContext *s);
void ff_msmpeg4_encode_motion(MpegEncContext * s, int mx, int my);

void ff_msmpeg4_code012(PutBitContext *pb, int n);

#define CONFIG_MSMPEG4_ENCODER (CONFIG_MSMPEG4V2_ENCODER || \
                                CONFIG_MSMPEG4V3_ENCODER || \
                                CONFIG_WMV1_ENCODER      || \
                                CONFIG_WMV2_ENCODER)

#endif