FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dirac_vlc.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Open Broadcast Systems Ltd.
3  * Author 2016 Rostislav Pehlivanov <rpehlivanov@obe.tv>
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_DIRAC_VLC_H
23 #define AVCODEC_DIRAC_VLC_H
24 
25 #include "libavutil/avutil.h"
26 
27 /* Can be 32 bits wide for some performance gain on some machines, but it will
28  * incorrectly decode very long coefficients (usually only 1 or 2 per frame) */
29 typedef uint64_t residual;
30 
31 #define LUT_BITS 8
32 
33 /* Exactly 64 bytes */
34 typedef struct DiracGolombLUT {
38  int8_t need_s, sign;
40 
42 
44  int bytes, uint8_t *dst, int coeffs);
45 
47  int bytes, uint8_t *_dst, int coeffs);
48 
50 
51 #endif /* AVCODEC_DIRAC_VLC_H */
int ff_dirac_golomb_read_32bit(DiracGolombLUT *lut_ctx, const uint8_t *buf, int bytes, uint8_t *dst, int coeffs)
Definition: dirac_vlc.c:42
Convenience header that includes libavutil's core.
av_cold void ff_dirac_golomb_reader_end(DiracGolombLUT **lut_ctx)
Definition: dirac_vlc.c:249
uint8_t
#define av_cold
Definition: attributes.h:82
av_cold int ff_dirac_golomb_reader_init(DiracGolombLUT **lut_ctx)
Definition: dirac_vlc.c:232
int32_t ready[LUT_BITS]
Definition: dirac_vlc.h:36
int32_t preamble_bits
Definition: dirac_vlc.h:37
uint64_t residual
Definition: dirac_vlc.h:29
int32_t ready_num
Definition: dirac_vlc.h:37
int32_t
int8_t sign
Definition: dirac_vlc.h:38
void * buf
Definition: avisynth_c.h:690
int32_t leftover_bits
Definition: dirac_vlc.h:37
int ff_dirac_golomb_read_16bit(DiracGolombLUT *lut_ctx, const uint8_t *buf, int bytes, uint8_t *_dst, int coeffs)
Definition: dirac_vlc.c:82
residual leftover
Definition: dirac_vlc.h:35
static const int16_t coeffs[]
residual preamble
Definition: dirac_vlc.h:35
int8_t need_s
Definition: dirac_vlc.h:38
#define LUT_BITS
Definition: dirac_vlc.h:31