summaryrefslogtreecommitdiff
path: root/src/libffmpeg/libavcodec/rv10.c
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-03-26 14:43:46 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-03-26 14:43:46 +0000
commita5adaebc130805962f83deccb29f47a7a2384fc8 (patch)
tree50ce22f99ced67b6d975632574ce4b392ed820ad /src/libffmpeg/libavcodec/rv10.c
parent689bd7704fde776152e6883ce1b6022ec638304b (diff)
downloadxine-lib-a5adaebc130805962f83deccb29f47a7a2384fc8.tar.gz
xine-lib-a5adaebc130805962f83deccb29f47a7a2384fc8.tar.bz2
update ffmpeg. trying to keep local changes (see diff_to_ffmpeg_cvs.txt), let me
know if i overlooked something. as usual, preliminary QA: tested non debug builds and several codecs including divx3/4/5, mpeg4, xvid, msmpeg4v3, svq1, wmv7, dv (video/audio), wma i also enabled wmv8 by default since it worked fine with the streams i have. i'm not sure about current state of that so we might enable it only for non-x86 users in case of trouble. CVS patchset: 4488 CVS date: 2003/03/26 14:43:46
Diffstat (limited to 'src/libffmpeg/libavcodec/rv10.c')
-rw-r--r--src/libffmpeg/libavcodec/rv10.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/src/libffmpeg/libavcodec/rv10.c b/src/libffmpeg/libavcodec/rv10.c
index 012b1dc5c..8244cb5dc 100644
--- a/src/libffmpeg/libavcodec/rv10.c
+++ b/src/libffmpeg/libavcodec/rv10.c
@@ -16,6 +16,12 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
+/**
+ * @file rv10.c
+ * RV10 codec.
+ */
+
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
@@ -24,7 +30,7 @@
#define DC_VLC_BITS 14 //FIXME find a better solution
-static const UINT16 rv_lum_code[256] =
+static const uint16_t rv_lum_code[256] =
{
0x3e7f, 0x0f00, 0x0f01, 0x0f02, 0x0f03, 0x0f04, 0x0f05, 0x0f06,
0x0f07, 0x0f08, 0x0f09, 0x0f0a, 0x0f0b, 0x0f0c, 0x0f0d, 0x0f0e,
@@ -60,7 +66,7 @@ static const UINT16 rv_lum_code[256] =
0x0f78, 0x0f79, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f7e, 0x0f7f,
};
-static const UINT8 rv_lum_bits[256] =
+static const uint8_t rv_lum_bits[256] =
{
14, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12,
@@ -96,7 +102,7 @@ static const UINT8 rv_lum_bits[256] =
12, 12, 12, 12, 12, 12, 12, 12,
};
-static const UINT16 rv_chrom_code[256] =
+static const uint16_t rv_chrom_code[256] =
{
0xfe7f, 0x3f00, 0x3f01, 0x3f02, 0x3f03, 0x3f04, 0x3f05, 0x3f06,
0x3f07, 0x3f08, 0x3f09, 0x3f0a, 0x3f0b, 0x3f0c, 0x3f0d, 0x3f0e,
@@ -132,7 +138,7 @@ static const UINT16 rv_chrom_code[256] =
0x3f78, 0x3f79, 0x3f7a, 0x3f7b, 0x3f7c, 0x3f7d, 0x3f7e, 0x3f7f,
};
-static const UINT8 rv_chrom_bits[256] =
+static const uint8_t rv_chrom_bits[256] =
{
16, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14,
@@ -182,14 +188,14 @@ int rv_decode_dc(MpegEncContext *s, int n)
if they had thought about it !!! */
code = get_bits(&s->gb, 7);
if (code == 0x7c) {
- code = (INT8)(get_bits(&s->gb, 7) + 1);
+ code = (int8_t)(get_bits(&s->gb, 7) + 1);
} else if (code == 0x7d) {
code = -128 + get_bits(&s->gb, 7);
} else if (code == 0x7e) {
if (get_bits(&s->gb, 1) == 0)
- code = (INT8)(get_bits(&s->gb, 8) + 1);
+ code = (int8_t)(get_bits(&s->gb, 8) + 1);
else
- code = (INT8)(get_bits(&s->gb, 8));
+ code = (int8_t)(get_bits(&s->gb, 8));
} else if (code == 0x7f) {
get_bits(&s->gb, 11);
code = 1;
@@ -203,7 +209,7 @@ int rv_decode_dc(MpegEncContext *s, int n)
if (code < 0) {
code = get_bits(&s->gb, 9);
if (code == 0x1fc) {
- code = (INT8)(get_bits(&s->gb, 7) + 1);
+ code = (int8_t)(get_bits(&s->gb, 7) + 1);
} else if (code == 0x1fd) {
code = -128 + get_bits(&s->gb, 7);
} else if (code == 0x1fe) {
@@ -220,6 +226,8 @@ int rv_decode_dc(MpegEncContext *s, int n)
return -code;
}
+#ifdef CONFIG_ENCODERS
+
/* write RV 1.0 compatible frame header */
void rv10_encode_picture_header(MpegEncContext *s, int picture_number)
{
@@ -262,6 +270,8 @@ static int get_num(GetBitContext *gb)
}
}
+#endif //CONFIG_ENCODERS
+
/* read RV 1.0 compatible frame header */
static int rv10_decode_picture_header(MpegEncContext *s)
{
@@ -330,7 +340,7 @@ static int rv10_decode_picture_header(MpegEncContext *s)
static int rv10_decode_init(AVCodecContext *avctx)
{
MpegEncContext *s = avctx->priv_data;
- static int done;
+ static int done=0;
s->avctx= avctx;
s->out_format = FMT_H263;
@@ -390,7 +400,7 @@ static int rv10_decode_end(AVCodecContext *avctx)
}
static int rv10_decode_packet(AVCodecContext *avctx,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
MpegEncContext *s = avctx->priv_data;
int i, mb_count, mb_pos, left;
@@ -468,7 +478,7 @@ static int rv10_decode_packet(AVCodecContext *avctx,
static int rv10_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
- UINT8 *buf, int buf_size)
+ uint8_t *buf, int buf_size)
{
MpegEncContext *s = avctx->priv_data;
int i;