summaryrefslogtreecommitdiff
path: root/src/libffmpeg/libavcodec/huffyuv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libffmpeg/libavcodec/huffyuv.c')
-rw-r--r--src/libffmpeg/libavcodec/huffyuv.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/libffmpeg/libavcodec/huffyuv.c b/src/libffmpeg/libavcodec/huffyuv.c
index d65943fcc..0aefd6d72 100644
--- a/src/libffmpeg/libavcodec/huffyuv.c
+++ b/src/libffmpeg/libavcodec/huffyuv.c
@@ -3,18 +3,20 @@
*
* Copyright (c) 2002-2003 Michael Niedermayer <michaelni@gmx.at>
*
- * This library is free software; you can redistribute it and/or
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of
@@ -236,6 +238,7 @@ static int generate_bits_table(uint32_t *dst, uint8_t *len_table){
return 0;
}
+#ifdef CONFIG_ENCODERS
static void generate_len_table(uint8_t *dst, uint64_t *stats, int size){
uint64_t counts[2*size];
int up[2*size];
@@ -291,6 +294,7 @@ static void generate_len_table(uint8_t *dst, uint64_t *stats, int size){
if(i==size) break;
}
}
+#endif /* CONFIG_ENCODERS */
static int read_huffman_tables(HYuvContext *s, uint8_t *src, int length){
GetBitContext gb;
@@ -375,6 +379,7 @@ static int common_init(AVCodecContext *avctx){
return 0;
}
+#ifdef CONFIG_DECODERS
static int decode_init(AVCodecContext *avctx)
{
HYuvContext *s = avctx->priv_data;
@@ -470,7 +475,9 @@ s->bgr32=1;
return 0;
}
+#endif
+#ifdef CONFIG_ENCODERS
static int store_table(HYuvContext *s, uint8_t *len, uint8_t *buf){
int i;
int index= 0;
@@ -612,6 +619,7 @@ static int encode_init(AVCodecContext *avctx)
return 0;
}
+#endif /* CONFIG_ENCODERS */
static void decode_422_bitstream(HYuvContext *s, int count){
int i;
@@ -637,6 +645,7 @@ static void decode_gray_bitstream(HYuvContext *s, int count){
}
}
+#ifdef CONFIG_ENCODERS
static int encode_422_bitstream(HYuvContext *s, int count){
int i;
@@ -711,6 +720,7 @@ static int encode_gray_bitstream(HYuvContext *s, int count){
}
return 0;
}
+#endif /* CONFIG_ENCODERS */
static void decode_bgr_bitstream(HYuvContext *s, int count){
int i;
@@ -748,6 +758,7 @@ static void decode_bgr_bitstream(HYuvContext *s, int count){
}
}
+#ifdef CONFIG_DECODERS
static void draw_slice(HYuvContext *s, int y){
int h, cy;
int offset[4];
@@ -1014,6 +1025,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
return (get_bits_count(&s->gb)+31)/32*4 + table_size;
}
+#endif
static int common_end(HYuvContext *s){
int i;
@@ -1024,6 +1036,7 @@ static int common_end(HYuvContext *s){
return 0;
}
+#ifdef CONFIG_DECODERS
static int decode_end(AVCodecContext *avctx)
{
HYuvContext *s = avctx->priv_data;
@@ -1038,7 +1051,9 @@ static int decode_end(AVCodecContext *avctx)
return 0;
}
+#endif
+#ifdef CONFIG_ENCODERS
static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
HYuvContext *s = avctx->priv_data;
AVFrame *pict = data;
@@ -1218,7 +1233,9 @@ static int encode_end(AVCodecContext *avctx)
return 0;
}
+#endif /* CONFIG_ENCODERS */
+#ifdef CONFIG_DECODERS
AVCodec huffyuv_decoder = {
"huffyuv",
CODEC_TYPE_VIDEO,
@@ -1244,6 +1261,7 @@ AVCodec ffvhuff_decoder = {
CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND,
NULL
};
+#endif
#ifdef CONFIG_ENCODERS
@@ -1255,6 +1273,7 @@ AVCodec huffyuv_encoder = {
encode_init,
encode_frame,
encode_end,
+ .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV422P, -1},
};
AVCodec ffvhuff_encoder = {
@@ -1265,6 +1284,7 @@ AVCodec ffvhuff_encoder = {
encode_init,
encode_frame,
encode_end,
+ .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, -1},
};
#endif //CONFIG_ENCODERS