2 * Common Ut Video header
3 * Copyright (c) 2011 Konstantin Shishkov
5 * This file is part of FFmpeg.
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.
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.
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
22 #ifndef AVCODEC_UTVIDEO_H
23 #define AVCODEC_UTVIDEO_H
27 * Common Ut Video header
30 #include "libavutil/common.h"
33 #include "utvideodsp.h"
34 #include "lossless_videodsp.h"
35 #include "lossless_videoencdsp.h"
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
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'),
64 /* Mapping of libavcodec prediction modes to Ut Video's */
65 extern const int ff_ut_pred_order[5];
67 typedef struct UtvideoContext {
69 AVCodecContext *avctx;
70 UTVideoDSPContext utdsp;
72 LLVidDSPContext llviddsp;
73 LLVidEncDSPContext llvidencdsp;
75 uint32_t frame_info_size, flags, frame_info, offset;
84 ptrdiff_t slice_stride;
85 uint8_t *slice_bits, *slice_buffer[4];
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];
94 typedef struct HuffEntry {
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);
104 #endif /* AVCODEC_UTVIDEO_H */