diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-13 01:56:33 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-13 01:56:33 +0100 |
commit | b25a265a5c921d2d223a8aeff2f918894d515934 (patch) | |
tree | 480f9648f685220520a344ac293f66e307abfc5c /libavcodec/s3tc.c | |
parent | 2d38081b4f65f23077cb1b27f2d08c82c45afa05 (diff) | |
parent | bd3e07c82ae558c2cc3616115161827630826ec1 (diff) | |
download | ffmpeg-b25a265a5c921d2d223a8aeff2f918894d515934.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
pcm-mpeg: convert to bytestream2 API
Revert "h264: clear trailing bits in partially parsed NAL units"
remove iwmmxt optimizations
mimic: do not continue if swap_buf_size is 0
mimic: convert to bytestream2 API
frwu: use MKTAG to check marker instead of AV_RL32
txd: port to bytestream2 API
c93: convert to bytestream2 API
iff: make .long_name more descriptive
FATE: add test for cdxl demuxer
rtsp: Fix a typo
Conflicts:
libavcodec/arm/dsputil_iwmmxt.c
libavcodec/arm/dsputil_iwmmxt_rnd_template.c
libavcodec/arm/mpegvideo_iwmmxt.c
libavcodec/c93.c
libavcodec/txd.c
libavutil/arm/cpu.c
tests/fate/demux.mak
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/s3tc.c')
-rw-r--r-- | libavcodec/s3tc.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/libavcodec/s3tc.c b/libavcodec/s3tc.c index 8e979a84ac..4e791c86c0 100644 --- a/libavcodec/s3tc.c +++ b/libavcodec/s3tc.c @@ -21,19 +21,19 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "libavutil/intreadwrite.h" +#include "libavcodec/bytestream.h" #include "avcodec.h" #include "s3tc.h" -static inline void dxt1_decode_pixels(const uint8_t *s, uint32_t *d, +static inline void dxt1_decode_pixels(GetByteContext *gb, uint32_t *d, unsigned int qstride, unsigned int flag, uint64_t alpha) { unsigned int x, y, c0, c1, a = (!flag * 255u) << 24; unsigned int rb0, rb1, rb2, rb3, g0, g1, g2, g3; uint32_t colors[4], pixels; - c0 = AV_RL16(s); - c1 = AV_RL16(s+2); + c0 = bytestream2_get_le16(gb); + c1 = bytestream2_get_le16(gb); rb0 = (c0<<3 | c0<<8) & 0xf800f8; rb1 = (c1<<3 | c1<<8) & 0xf800f8; @@ -61,7 +61,7 @@ static inline void dxt1_decode_pixels(const uint8_t *s, uint32_t *d, colors[2] = rb2 + g2 + a; - pixels = AV_RL32(s+4); + pixels = bytestream2_get_le32(gb); for (y=0; y<4; y++) { for (x=0; x<4; x++) { a = (alpha & 0x0f) << 28; @@ -74,24 +74,24 @@ static inline void dxt1_decode_pixels(const uint8_t *s, uint32_t *d, } } -void ff_decode_dxt1(const uint8_t *s, uint8_t *dst, +void ff_decode_dxt1(GetByteContext *gb, uint8_t *dst, const unsigned int w, const unsigned int h, const unsigned int stride) { unsigned int bx, by, qstride = stride/4; uint32_t *d = (uint32_t *) dst; for (by=0; by < h/4; by++, d += stride-w) - for (bx=0; bx < w/4; bx++, s+=8, d+=4) - dxt1_decode_pixels(s, d, qstride, 0, 0LL); + for (bx = 0; bx < w / 4; bx++, d += 4) + dxt1_decode_pixels(gb, d, qstride, 0, 0LL); } -void ff_decode_dxt3(const uint8_t *s, uint8_t *dst, +void ff_decode_dxt3(GetByteContext *gb, uint8_t *dst, const unsigned int w, const unsigned int h, const unsigned int stride) { unsigned int bx, by, qstride = stride/4; uint32_t *d = (uint32_t *) dst; for (by=0; by < h/4; by++, d += stride-w) - for (bx=0; bx < w/4; bx++, s+=16, d+=4) - dxt1_decode_pixels(s+8, d, qstride, 1, AV_RL64(s)); + for (bx = 0; bx < w / 4; bx++, d += 4) + dxt1_decode_pixels(gb, d, qstride, 1, bytestream2_get_le64(gb)); } |