]> git.sesse.net Git - ffmpeg/blob - libavcodec/utvideo.h
hevc: 16x16 NEON idct: Use the right element size for loads/stores
[ffmpeg] / libavcodec / utvideo.h
1 /*
2  * Common Ut Video header
3  * Copyright (c) 2011 Konstantin Shishkov
4  *
5  * This file is part of Libav.
6  *
7  * Libav 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  * Libav 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 Libav; 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 "huffyuvdsp.h"
34 #include "huffyuvencdsp.h"
35
36 enum {
37     PRED_NONE = 0,
38     PRED_LEFT,
39     PRED_GRADIENT,
40     PRED_MEDIAN,
41 };
42
43 enum {
44     COMP_NONE = 0,
45     COMP_HUFF,
46 };
47
48 /*
49  * "Original format" markers.
50  * Based on values gotten from the official VFW encoder.
51  * They are not used during decoding, but they do have
52  * an informative role on seeing what was input
53  * to the encoder.
54  */
55 enum {
56     UTVIDEO_RGB  = MKTAG(0x00, 0x00, 0x01, 0x18),
57     UTVIDEO_RGBA = MKTAG(0x00, 0x00, 0x02, 0x18),
58     UTVIDEO_420  = MKTAG('Y', 'V', '1', '2'),
59     UTVIDEO_422  = MKTAG('Y', 'U', 'Y', '2'),
60 };
61
62 /* Mapping of libavcodec prediction modes to Ut Video's */
63 extern const int ff_ut_pred_order[5];
64
65 /* Order of RGB(A) planes in Ut Video */
66 extern const int ff_ut_rgb_order[4];
67
68 typedef struct UtvideoContext {
69     const AVClass *class;
70     AVCodecContext *avctx;
71     BswapDSPContext bdsp;
72     HuffYUVDSPContext hdspdec;
73     HuffYUVEncDSPContext hdsp;
74
75     uint32_t frame_info_size, flags, frame_info;
76     int      planes;
77     int      slices;
78     int      compression;
79     int      interlaced;
80     int      frame_pred;
81     int      pro;
82
83     ptrdiff_t slice_stride;
84     uint8_t *slice_bits, *slice_buffer[4];
85     int      slice_bits_size;
86 } UtvideoContext;
87
88 typedef struct HuffEntry {
89     uint16_t sym;
90     uint8_t  len;
91     uint32_t code;
92 } HuffEntry;
93
94 /* Compare huffman tree nodes */
95 int ff_ut_huff_cmp_len(const void *a, const void *b);
96 int ff_ut10_huff_cmp_len(const void *a, const void *b);
97
98 #endif /* AVCODEC_UTVIDEO_H */