~ubuntu-dev/mplayer/ubuntu-feisty

« back to all changes in this revision

Viewing changes to libavcodec/huffyuv.c

  • Committer: William Grant
  • Date: 2007-02-03 03:16:07 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: william.grant@ubuntu.org.au-20070203031607-08gc2ompbz6spt9i
Update to 1.0rc1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *
4
4
 * Copyright (c) 2002-2003 Michael Niedermayer <michaelni@gmx.at>
5
5
 *
6
 
 * This library is free software; you can redistribute it and/or
 
6
 * This file is part of FFmpeg.
 
7
 *
 
8
 * FFmpeg is free software; you can redistribute it and/or
7
9
 * modify it under the terms of the GNU Lesser General Public
8
10
 * License as published by the Free Software Foundation; either
9
 
 * version 2 of the License, or (at your option) any later version.
 
11
 * version 2.1 of the License, or (at your option) any later version.
10
12
 *
11
 
 * This library is distributed in the hope that it will be useful,
 
13
 * FFmpeg is distributed in the hope that it will be useful,
12
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
16
 * Lesser General Public License for more details.
15
17
 *
16
18
 * You should have received a copy of the GNU Lesser General Public
17
 
 * License along with this library; if not, write to the Free Software
 
19
 * License along with FFmpeg; if not, write to the Free Software
18
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
21
 *
20
22
 * see http://www.pcisys.net/~melanson/codecs/huffyuv.txt for a description of
236
238
    return 0;
237
239
}
238
240
 
 
241
#ifdef CONFIG_ENCODERS
239
242
static void generate_len_table(uint8_t *dst, uint64_t *stats, int size){
240
243
    uint64_t counts[2*size];
241
244
    int up[2*size];
291
294
        if(i==size) break;
292
295
    }
293
296
}
 
297
#endif /* CONFIG_ENCODERS */
294
298
 
295
299
static int read_huffman_tables(HYuvContext *s, uint8_t *src, int length){
296
300
    GetBitContext gb;
375
379
    return 0;
376
380
}
377
381
 
 
382
#ifdef CONFIG_DECODERS
378
383
static int decode_init(AVCodecContext *avctx)
379
384
{
380
385
    HYuvContext *s = avctx->priv_data;
470
475
 
471
476
    return 0;
472
477
}
 
478
#endif
473
479
 
 
480
#ifdef CONFIG_ENCODERS
474
481
static int store_table(HYuvContext *s, uint8_t *len, uint8_t *buf){
475
482
    int i;
476
483
    int index= 0;
612
619
 
613
620
    return 0;
614
621
}
 
622
#endif /* CONFIG_ENCODERS */
615
623
 
616
624
static void decode_422_bitstream(HYuvContext *s, int count){
617
625
    int i;
637
645
    }
638
646
}
639
647
 
 
648
#ifdef CONFIG_ENCODERS
640
649
static int encode_422_bitstream(HYuvContext *s, int count){
641
650
    int i;
642
651
 
711
720
    }
712
721
    return 0;
713
722
}
 
723
#endif /* CONFIG_ENCODERS */
714
724
 
715
725
static void decode_bgr_bitstream(HYuvContext *s, int count){
716
726
    int i;
748
758
    }
749
759
}
750
760
 
 
761
#ifdef CONFIG_DECODERS
751
762
static void draw_slice(HYuvContext *s, int y){
752
763
    int h, cy;
753
764
    int offset[4];
1014
1025
 
1015
1026
    return (get_bits_count(&s->gb)+31)/32*4 + table_size;
1016
1027
}
 
1028
#endif
1017
1029
 
1018
1030
static int common_end(HYuvContext *s){
1019
1031
    int i;
1024
1036
    return 0;
1025
1037
}
1026
1038
 
 
1039
#ifdef CONFIG_DECODERS
1027
1040
static int decode_end(AVCodecContext *avctx)
1028
1041
{
1029
1042
    HYuvContext *s = avctx->priv_data;
1038
1051
 
1039
1052
    return 0;
1040
1053
}
 
1054
#endif
1041
1055
 
 
1056
#ifdef CONFIG_ENCODERS
1042
1057
static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
1043
1058
    HYuvContext *s = avctx->priv_data;
1044
1059
    AVFrame *pict = data;
1218
1233
 
1219
1234
    return 0;
1220
1235
}
 
1236
#endif /* CONFIG_ENCODERS */
1221
1237
 
 
1238
#ifdef CONFIG_DECODERS
1222
1239
AVCodec huffyuv_decoder = {
1223
1240
    "huffyuv",
1224
1241
    CODEC_TYPE_VIDEO,
1244
1261
    CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND,
1245
1262
    NULL
1246
1263
};
 
1264
#endif
1247
1265
 
1248
1266
#ifdef CONFIG_ENCODERS
1249
1267
 
1255
1273
    encode_init,
1256
1274
    encode_frame,
1257
1275
    encode_end,
 
1276
    .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV422P, -1},
1258
1277
};
1259
1278
 
1260
1279
AVCodec ffvhuff_encoder = {
1265
1284
    encode_init,
1266
1285
    encode_frame,
1267
1286
    encode_end,
 
1287
    .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, -1},
1268
1288
};
1269
1289
 
1270
1290
#endif //CONFIG_ENCODERS