FFmpeg
utvideo.h
Go to the documentation of this file.
1 /*
2  * Common Ut Video header
3  * Copyright (c) 2011 Konstantin Shishkov
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef AVCODEC_UTVIDEO_H
23 #define AVCODEC_UTVIDEO_H
24 
25 /**
26  * @file
27  * Common Ut Video header
28  */
29 
30 #include "libavutil/common.h"
31 #include "avcodec.h"
32 #include "bswapdsp.h"
33 #include "utvideodsp.h"
34 #include "lossless_videodsp.h"
35 #include "lossless_videoencdsp.h"
36 
37 enum {
38  PRED_NONE = 0,
42 };
43 
44 enum {
45  COMP_NONE = 0,
47 };
48 
49 /*
50  * "Original format" markers.
51  * Based on values gotten from the official VFW encoder.
52  * They are not used during decoding, but they do have
53  * an informative role on seeing what was input
54  * to the encoder.
55  */
56 enum {
57  UTVIDEO_RGB = MKTAG(0x00, 0x00, 0x01, 0x18),
58  UTVIDEO_RGBA = MKTAG(0x00, 0x00, 0x02, 0x18),
59  UTVIDEO_420 = MKTAG('Y', 'V', '1', '2'),
60  UTVIDEO_422 = MKTAG('Y', 'U', 'Y', '2'),
61  UTVIDEO_444 = MKTAG('Y', 'V', '2', '4'),
62 };
63 
64 /* Mapping of libavcodec prediction modes to Ut Video's */
65 extern const int ff_ut_pred_order[5];
66 
67 typedef struct UtvideoContext {
68  const AVClass *class;
74 
76  int planes;
77  int slices;
81  int pro;
82  int pack;
83 
84  ptrdiff_t slice_stride;
87 
88  const uint8_t *packed_stream[4][256];
89  size_t packed_stream_size[4][256];
90  const uint8_t *control_stream[4][256];
91  size_t control_stream_size[4][256];
93 
94 typedef struct HuffEntry {
95  uint16_t sym;
96  uint8_t len;
97  uint32_t code;
98 } HuffEntry;
99 
100 /* Compare huffman tree nodes */
101 int ff_ut_huff_cmp_len(const void *a, const void *b);
102 int ff_ut10_huff_cmp_len(const void *a, const void *b);
103 
104 #endif /* AVCODEC_UTVIDEO_H */
UTVideoDSPContext
Definition: utvideodsp.h:27
UTVIDEO_444
@ UTVIDEO_444
Definition: utvideo.h:61
bswapdsp.h
HuffEntry::len
uint8_t len
Definition: magicyuv.c:49
MKTAG
#define MKTAG(a, b, c, d)
Definition: common.h:366
UtvideoContext::llviddsp
LLVidDSPContext llviddsp
Definition: utvideo.h:72
b
#define b
Definition: input.c:41
UtvideoContext::offset
uint32_t offset
Definition: utvideo.h:75
UtvideoContext::slices
int slices
Definition: utvideo.h:77
UTVIDEO_422
@ UTVIDEO_422
Definition: utvideo.h:60
LLVidDSPContext
Definition: lossless_videodsp.h:31
HuffEntry::sym
uint16_t sym
Definition: magicyuv.c:48
UtvideoContext::interlaced
int interlaced
Definition: utvideo.h:79
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:67
UtvideoContext::control_stream
const uint8_t * control_stream[4][256]
Definition: utvideo.h:90
UtvideoContext::frame_pred
int frame_pred
Definition: utvideo.h:80
UtvideoContext::frame_info
uint32_t frame_info
Definition: utvideo.h:75
UtvideoContext::slice_stride
ptrdiff_t slice_stride
Definition: utvideo.h:84
ff_ut_huff_cmp_len
int ff_ut_huff_cmp_len(const void *a, const void *b)
Definition: utvideo.c:37
UtvideoContext::packed_stream
const uint8_t * packed_stream[4][256]
Definition: utvideo.h:88
COMP_HUFF
@ COMP_HUFF
Definition: utvideo.h:46
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
lossless_videoencdsp.h
COMP_NONE
@ COMP_NONE
Definition: utvideo.h:45
common.h
uint8_t
uint8_t
Definition: audio_convert.c:194
ff_ut_pred_order
const int ff_ut_pred_order[5]
Definition: utvideo.c:30
UtvideoContext
Definition: utvideo.h:67
LLVidEncDSPContext
Definition: lossless_videoencdsp.h:26
UtvideoContext::pack
int pack
Definition: utvideo.h:82
avcodec.h
PRED_MEDIAN
@ PRED_MEDIAN
Definition: utvideo.h:41
HuffEntry::code
uint32_t code
Definition: magicyuv.c:50
UtvideoContext::llvidencdsp
LLVidEncDSPContext llvidencdsp
Definition: utvideo.h:73
UtvideoContext::frame_info_size
uint32_t frame_info_size
Definition: utvideo.h:75
UtvideoContext::slice_buffer
uint8_t * slice_buffer[4]
Definition: utvideo.h:85
AVCodecContext
main external API structure.
Definition: avcodec.h:1565
PRED_GRADIENT
@ PRED_GRADIENT
Definition: utvideo.h:40
PRED_NONE
@ PRED_NONE
Definition: utvideo.h:38
ff_ut10_huff_cmp_len
int ff_ut10_huff_cmp_len(const void *a, const void *b)
Definition: utvideo.c:43
HuffEntry
Definition: magicyuv.c:47
UtvideoContext::compression
int compression
Definition: utvideo.h:78
UtvideoContext::flags
uint32_t flags
Definition: utvideo.h:75
UtvideoContext::slice_bits
uint8_t * slice_bits
Definition: utvideo.h:85
UTVIDEO_RGB
@ UTVIDEO_RGB
Definition: utvideo.h:57
lossless_videodsp.h
PRED_LEFT
@ PRED_LEFT
Definition: utvideo.h:39
UtvideoContext::slice_bits_size
int slice_bits_size
Definition: utvideo.h:86
utvideodsp.h
UtvideoContext::bdsp
BswapDSPContext bdsp
Definition: utvideo.h:71
UTVIDEO_420
@ UTVIDEO_420
Definition: utvideo.h:59
UtvideoContext::pro
int pro
Definition: utvideo.h:81
BswapDSPContext
Definition: bswapdsp.h:24
UtvideoContext::avctx
AVCodecContext * avctx
Definition: utvideo.h:69
UtvideoContext::packed_stream_size
size_t packed_stream_size[4][256]
Definition: utvideo.h:89
UtvideoContext::control_stream_size
size_t control_stream_size[4][256]
Definition: utvideo.h:91
UtvideoContext::utdsp
UTVideoDSPContext utdsp
Definition: utvideo.h:70
UTVIDEO_RGBA
@ UTVIDEO_RGBA
Definition: utvideo.h:58
UtvideoContext::planes
int planes
Definition: utvideo.h:76