~ppsspp/ppsspp/ffmpeg

« back to all changes in this revision

Viewing changes to libavcodec/dvdata.h

  • Committer: Henrik Rydgård
  • Date: 2014-01-03 10:44:32 UTC
  • Revision ID: git-v1:87c6c126784b1718bfa448ecf2e6a9fef781eb4e
Update our ffmpeg snapshot to a clone of the official repository.

This is because Maxim's at3plus support has been officially merged!

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Constants for DV codec
3
 
 * Copyright (c) 2002 Fabrice Bellard
4
 
 *
5
2
 * This file is part of FFmpeg.
6
3
 *
7
4
 * FFmpeg is free software; you can redistribute it and/or
19
16
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
17
 */
21
18
 
22
 
/**
23
 
 * @file
24
 
 * Constants for DV codec.
25
 
 */
26
 
 
27
19
#ifndef AVCODEC_DVDATA_H
28
20
#define AVCODEC_DVDATA_H
29
21
 
30
 
#include "avcodec.h"
31
 
#include "dsputil.h"
32
 
#include "get_bits.h"
33
 
#include "dv_profile.h"
34
 
 
35
 
typedef struct DVVideoContext {
36
 
    const DVprofile *sys;
37
 
    AVFrame          picture;
38
 
    AVCodecContext  *avctx;
39
 
    uint8_t         *buf;
40
 
 
41
 
    uint8_t  dv_zigzag[2][64];
42
 
 
43
 
    void (*get_pixels)(int16_t *block, const uint8_t *pixels, int line_size);
44
 
    void (*fdct[2])(int16_t *block);
45
 
    void (*idct_put[2])(uint8_t *dest, int line_size, int16_t *block);
46
 
    me_cmp_func ildct_cmp;
47
 
} DVVideoContext;
48
 
 
49
 
enum dv_section_type {
50
 
     dv_sect_header  = 0x1f,
51
 
     dv_sect_subcode = 0x3f,
52
 
     dv_sect_vaux    = 0x56,
53
 
     dv_sect_audio   = 0x76,
54
 
     dv_sect_video   = 0x96,
55
 
};
56
 
 
57
 
enum dv_pack_type {
58
 
     dv_header525     = 0x3f, /* see dv_write_pack for important details on */
59
 
     dv_header625     = 0xbf, /* these two packs */
60
 
     dv_timecode      = 0x13,
61
 
     dv_audio_source  = 0x50,
62
 
     dv_audio_control = 0x51,
63
 
     dv_audio_recdate = 0x52,
64
 
     dv_audio_rectime = 0x53,
65
 
     dv_video_source  = 0x60,
66
 
     dv_video_control = 0x61,
67
 
     dv_video_recdate = 0x62,
68
 
     dv_video_rectime = 0x63,
69
 
     dv_unknown_pack  = 0xff,
70
 
};
 
22
#include <stdint.h>
71
23
 
72
24
extern const uint8_t ff_dv_quant_shifts[22][4];
73
25
extern const uint8_t ff_dv_quant_offset[4];
79
31
extern const int ff_dv_iweight_720_y[64];
80
32
extern const int ff_dv_iweight_720_c[64];
81
33
 
82
 
#define DV_PROFILE_IS_HD(p) ((p)->video_stype & 0x10)
83
 
#define DV_PROFILE_IS_1080i50(p) (((p)->video_stype == 0x14) && ((p)->dsf == 1))
84
 
#define DV_PROFILE_IS_720p50(p)  (((p)->video_stype == 0x18) && ((p)->dsf == 1))
85
 
 
86
 
/**
87
 
 * largest possible DV frame, in bytes (1080i50)
88
 
 */
89
 
#define DV_MAX_FRAME_SIZE 576000
90
 
 
91
 
/**
92
 
 * maximum number of blocks per macroblock in any DV format
93
 
 */
94
 
#define DV_MAX_BPM 8
95
 
 
96
 
#define TEX_VLC_BITS 9
97
 
 
98
 
extern RL_VLC_ELEM ff_dv_rl_vlc[1184];
99
 
 
100
 
int ff_dv_init_dynamic_tables(const DVprofile *d);
101
 
int ff_dvvideo_init(AVCodecContext *avctx);
102
 
 
103
 
static inline int dv_work_pool_size(const DVprofile *d)
104
 
{
105
 
    int size = d->n_difchan*d->difseg_size*27;
106
 
    if (DV_PROFILE_IS_1080i50(d))
107
 
        size -= 3*27;
108
 
    if (DV_PROFILE_IS_720p50(d))
109
 
        size -= 4*27;
110
 
    return size;
111
 
}
112
 
 
113
 
static inline void dv_calculate_mb_xy(DVVideoContext *s, DVwork_chunk *work_chunk, int m, int *mb_x, int *mb_y)
114
 
{
115
 
     *mb_x = work_chunk->mb_coordinates[m] & 0xff;
116
 
     *mb_y = work_chunk->mb_coordinates[m] >> 8;
117
 
 
118
 
     /* We work with 720p frames split in half. The odd half-frame (chan==2,3) is displaced :-( */
119
 
     if (s->sys->height == 720 && !(s->buf[1]&0x0C)) {
120
 
         *mb_y -= (*mb_y>17)?18:-72; /* shifting the Y coordinate down by 72/2 macro blocks */
121
 
     }
122
 
}
 
34
#define NB_DV_VLC 409
 
35
 
 
36
extern const uint16_t ff_dv_vlc_bits[NB_DV_VLC];
 
37
extern const uint8_t ff_dv_vlc_len[NB_DV_VLC];
 
38
extern const uint8_t ff_dv_vlc_run[NB_DV_VLC];
 
39
extern const uint8_t ff_dv_vlc_level[NB_DV_VLC];
123
40
 
124
41
#endif /* AVCODEC_DVDATA_H */