annotate rle.h @ 6920:d02af7474bff libavcodec

Prevent 128*1<<trellis from becoming 0 and creating 0 sized arrays. fixes CID84 RUN2 CID85 RUN2 CID86 RUN2 CID87 RUN2 CID88 RUN2 CID89 RUN2 CID90 RUN2 CID91 RUN2 CID92 RUN2 CID93 RUN2 CID94 RUN2 CID95 RUN2 CID96 RUN2 CID97 RUN2 CID98 RUN2 CID99 RUN2 CID100 RUN2 CID101 RUN2 CID102 RUN2 CID103 RUN2 CID104 RUN2 CID105 RUN2 CID106 RUN2
author michael
date Wed, 28 May 2008 11:59:41 +0000
parents 1d83e9c34641
children c4a4495715dd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4767
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
1 /*
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
2 * RLE encoder
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
3 *
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
4 * This file is part of FFmpeg.
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
5 *
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
10 *
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
14 * Lesser General Public License for more details.
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
15 *
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
19 */
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
20
5830
1d83e9c34641 Add FFMPEG_ prefix to all multiple inclusion guards.
diego
parents: 5215
diff changeset
21 #ifndef FFMPEG_RLE_H
1d83e9c34641 Add FFMPEG_ prefix to all multiple inclusion guards.
diego
parents: 5215
diff changeset
22 #define FFMPEG_RLE_H
4767
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
23
5162
4394344397d8 include all prerequisites in header files
mru
parents: 4772
diff changeset
24 #include <stdint.h>
4394344397d8 include all prerequisites in header files
mru
parents: 4772
diff changeset
25
4768
542e4c4fc15a move doxy from .c to .h
michael
parents: 4767
diff changeset
26 /**
4771
7cd3ffe4897f Changed the rle encoder a little and made it more universal.
michael
parents: 4768
diff changeset
27 * RLE compress the row, with maximum size of out_size. Value before repeated bytes is (count ^ xor_rep) + add_rep.
7cd3ffe4897f Changed the rle encoder a little and made it more universal.
michael
parents: 4768
diff changeset
28 * Value before raw bytes is (count ^ xor_raw) + add_raw.
4768
542e4c4fc15a move doxy from .c to .h
michael
parents: 4767
diff changeset
29 * @param outbuf Output buffer
542e4c4fc15a move doxy from .c to .h
michael
parents: 4767
diff changeset
30 * @param out_size Maximum output size
542e4c4fc15a move doxy from .c to .h
michael
parents: 4767
diff changeset
31 * @param ptr Input buffer
542e4c4fc15a move doxy from .c to .h
michael
parents: 4767
diff changeset
32 * @param bpp Bytes per pixel
542e4c4fc15a move doxy from .c to .h
michael
parents: 4767
diff changeset
33 * @param w Image width
542e4c4fc15a move doxy from .c to .h
michael
parents: 4767
diff changeset
34 * @return Size of output in bytes, or -1 if larger than out_size
542e4c4fc15a move doxy from .c to .h
michael
parents: 4767
diff changeset
35 */
4771
7cd3ffe4897f Changed the rle encoder a little and made it more universal.
michael
parents: 4768
diff changeset
36 int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *inbuf, int bpp, int w,
4772
3cd67a410b68 dont use *int8_t for the arguments (ive missed that in the patches ...)
michael
parents: 4771
diff changeset
37 int add_rep, int xor_rep, int add_raw, int xor_raw);
4767
a3667e74f44b generic rle encoder by Bartlomiej Wolowiec b.wolowiec students mimuw edu pl
michael
parents:
diff changeset
38
5830
1d83e9c34641 Add FFMPEG_ prefix to all multiple inclusion guards.
diego
parents: 5215
diff changeset
39 #endif /* FFMPEG_RLE_H */