Commit c5fd9d3c authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  fate: Add proper dependencies in qt.mak
  fate: Add proper dependencies in lossless-video.mak
  indeo3: do not try to output more lines than we can fit
  bmv: get a new frame on every decode_frame(), so we can use direct rendering

Conflicts:
	libavcodec/bmv.c
	tests/fate/lossless-video.mak
	tests/fate/qt.mak
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 81ff0c24 61cc9974
...@@ -198,7 +198,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac ...@@ -198,7 +198,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
{ {
BMVDecContext * const c = avctx->priv_data; BMVDecContext * const c = avctx->priv_data;
int type, scr_off; int type, scr_off;
int i; int i, ret;
uint8_t *srcptr, *outptr; uint8_t *srcptr, *outptr;
c->stream = pkt->data; c->stream = pkt->data;
...@@ -239,6 +239,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac ...@@ -239,6 +239,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
scr_off = 0; scr_off = 0;
} }
if (c->pic.data[0])
avctx->release_buffer(avctx, &c->pic);
c->pic.reference = 3;
if ((ret = avctx->get_buffer(avctx, &c->pic)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
}
if (decode_bmv_frame(c->stream, pkt->size - (c->stream - pkt->data), c->frame, scr_off)) { if (decode_bmv_frame(c->stream, pkt->size - (c->stream - pkt->data), c->frame, scr_off)) {
av_log(avctx, AV_LOG_ERROR, "Error decoding frame data\n"); av_log(avctx, AV_LOG_ERROR, "Error decoding frame data\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
...@@ -275,12 +284,6 @@ static av_cold int decode_init(AVCodecContext *avctx) ...@@ -275,12 +284,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
c->pic.reference = 1;
if (avctx->get_buffer(avctx, &c->pic) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
c->frame = c->frame_base + 640; c->frame = c->frame_base + 640;
return 0; return 0;
......
...@@ -1010,14 +1010,17 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx, ...@@ -1010,14 +1010,17 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
* @param[in] buf_sel indicates which frame buffer the input data stored in * @param[in] buf_sel indicates which frame buffer the input data stored in
* @param[out] dst pointer to the buffer receiving converted pixels * @param[out] dst pointer to the buffer receiving converted pixels
* @param[in] dst_pitch pitch for moving to the next y line * @param[in] dst_pitch pitch for moving to the next y line
* @param[in] dst_height output plane height
*/ */
static void output_plane(const Plane *plane, int buf_sel, uint8_t *dst, int dst_pitch) static void output_plane(const Plane *plane, int buf_sel, uint8_t *dst,
int dst_pitch, int dst_height)
{ {
int x,y; int x,y;
const uint8_t *src = plane->pixels[buf_sel]; const uint8_t *src = plane->pixels[buf_sel];
uint32_t pitch = plane->pitch; uint32_t pitch = plane->pitch;
for (y = 0; y < plane->height; y++) { dst_height = FFMIN(dst_height, plane->height);
for (y = 0; y < dst_height; y++) {
/* convert four pixels at once using SWAR */ /* convert four pixels at once using SWAR */
for (x = 0; x < plane->width >> 2; x++) { for (x = 0; x < plane->width >> 2; x++) {
AV_WN32A(dst, (AV_RN32A(src) & 0x7F7F7F7F) << 1); AV_WN32A(dst, (AV_RN32A(src) & 0x7F7F7F7F) << 1);
...@@ -1101,9 +1104,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, ...@@ -1101,9 +1104,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
return res; return res;
} }
output_plane(&ctx->planes[0], ctx->buf_sel, ctx->frame.data[0], ctx->frame.linesize[0]); output_plane(&ctx->planes[0], ctx->buf_sel,
output_plane(&ctx->planes[1], ctx->buf_sel, ctx->frame.data[1], ctx->frame.linesize[1]); ctx->frame.data[0], ctx->frame.linesize[0],
output_plane(&ctx->planes[2], ctx->buf_sel, ctx->frame.data[2], ctx->frame.linesize[2]); avctx->height);
output_plane(&ctx->planes[1], ctx->buf_sel,
ctx->frame.data[1], ctx->frame.linesize[1],
(avctx->height + 3) >> 2);
output_plane(&ctx->planes[2], ctx->buf_sel,
ctx->frame.data[2], ctx->frame.linesize[2],
(avctx->height + 3) >> 2);
*data_size = sizeof(AVFrame); *data_size = sizeof(AVFrame);
*(AVFrame*)data = ctx->frame; *(AVFrame*)data = ctx->frame;
...@@ -1132,5 +1141,6 @@ AVCodec ff_indeo3_decoder = { ...@@ -1132,5 +1141,6 @@ AVCodec ff_indeo3_decoder = {
.init = decode_init, .init = decode_init,
.close = decode_close, .close = decode_close,
.decode = decode_frame, .decode = decode_frame,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Intel Indeo 3"), .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo 3"),
}; };
...@@ -4,7 +4,7 @@ fate-cllc-rgb: CMD = framecrc -i $(SAMPLES)/cllc/sample-cllc-rgb.avi ...@@ -4,7 +4,7 @@ fate-cllc-rgb: CMD = framecrc -i $(SAMPLES)/cllc/sample-cllc-rgb.avi
FATE_CLLC += fate-cllc-argb FATE_CLLC += fate-cllc-argb
fate-cllc-argb: CMD = framecrc -i $(SAMPLES)/cllc/sample-cllc-argb.avi fate-cllc-argb: CMD = framecrc -i $(SAMPLES)/cllc/sample-cllc-argb.avi
FATE_LOSSLESS_VIDEO += $(FATE_CLLC) FATE_LOSSLESS_VIDEO-$(call DEMDEC, AVI, CLLC) += $(FATE_CLLC)
fate-cllc: $(FATE_CLLC) fate-cllc: $(FATE_CLLC)
FATE_LAGARITH += fate-lagarith-rgb24 FATE_LAGARITH += fate-lagarith-rgb24
...@@ -19,7 +19,7 @@ fate-lagarith-yuy2: CMD = framecrc -i $(SAMPLES)/lagarith/lag-yuy2.avi ...@@ -19,7 +19,7 @@ fate-lagarith-yuy2: CMD = framecrc -i $(SAMPLES)/lagarith/lag-yuy2.avi
FATE_LAGARITH += fate-lagarith-yv12 FATE_LAGARITH += fate-lagarith-yv12
fate-lagarith-yv12: CMD = framecrc -i $(SAMPLES)/lagarith/lag-yv12.avi fate-lagarith-yv12: CMD = framecrc -i $(SAMPLES)/lagarith/lag-yv12.avi
FATE_SAMPLES_AVCONV += $(FATE_LAGARITH) FATE_LOSSLESS_VIDEO-$(call DEMDEC, AVI, LAGARITH) += $(FATE_LAGARITH)
fate-lagarith: $(FATE_LAGARITH) fate-lagarith: $(FATE_LAGARITH)
FATE_LOCO += fate-loco-rgb FATE_LOCO += fate-loco-rgb
...@@ -28,22 +28,22 @@ fate-loco-rgb: CMD = framecrc -i $(SAMPLES)/loco/pig-loco-rgb.avi ...@@ -28,22 +28,22 @@ fate-loco-rgb: CMD = framecrc -i $(SAMPLES)/loco/pig-loco-rgb.avi
FATE_LOCO += fate-loco-yuy2 FATE_LOCO += fate-loco-yuy2
fate-loco-yuy2: CMD = framecrc -i $(SAMPLES)/loco/pig-loco-0.avi fate-loco-yuy2: CMD = framecrc -i $(SAMPLES)/loco/pig-loco-0.avi
FATE_LOSSLESS_VIDEO += $(FATE_LOCO) FATE_LOSSLESS_VIDEO-$(call DEMDEC, AVI, LOCO) += $(FATE_LOCO)
fate-loco: $(FATE_LOCO) fate-loco: $(FATE_LOCO)
FATE_LOSSLESS_VIDEO += fate-msrle-8bit FATE_LOSSLESS_VIDEO-$(call DEMDEC, AVI, MSRLE) += fate-msrle-8bit
fate-msrle-8bit: CMD = framecrc -i $(SAMPLES)/msrle/Search-RLE.avi -pix_fmt rgb24 fate-msrle-8bit: CMD = framecrc -i $(SAMPLES)/msrle/Search-RLE.avi -pix_fmt rgb24
FATE_LOSSLESS_VIDEO += fate-mszh FATE_LOSSLESS_VIDEO-$(call DEMDEC, AVI, MSZH) += fate-mszh
fate-mszh: CMD = framecrc -i $(SAMPLES)/lcl/mszh-1frame.avi fate-mszh: CMD = framecrc -i $(SAMPLES)/lcl/mszh-1frame.avi
FATE_LOSSLESS_VIDEO += fate-vble FATE_LOSSLESS_VIDEO-$(call DEMDEC, AVI, VBLE) += fate-vble
fate-vble: CMD = framecrc -i $(SAMPLES)/vble/flowers-partial-2MB.avi fate-vble: CMD = framecrc -i $(SAMPLES)/vble/flowers-partial-2MB.avi
FATE_LOSSLESS_VIDEO-$(CONFIG_ZLIB) += fate-zlib FATE_LOSSLESS_VIDEO-$(call DEMDEC, AVI, ZLIB) += fate-zlib
fate-zlib: CMD = framecrc -i $(SAMPLES)/lcl/zlib-1frame.avi fate-zlib: CMD = framecrc -i $(SAMPLES)/lcl/zlib-1frame.avi
FATE_LOSSLESS_VIDEO-$(CONFIG_ZLIB) += fate-zerocodec FATE_LOSSLESS_VIDEO-$(call DEMDEC, AVI, ZEROCODEC) += fate-zerocodec
fate-zerocodec: CMD = framecrc -i $(SAMPLES)/zerocodec/sample-zeco.avi fate-zerocodec: CMD = framecrc -i $(SAMPLES)/zerocodec/sample-zeco.avi
FATE_LOSSLESS_VIDEO += $(FATE_LOSSLESS_VIDEO-yes) FATE_LOSSLESS_VIDEO += $(FATE_LOSSLESS_VIDEO-yes)
......
FATE_QT += fate-8bps FATE_QT-$(call DEMDEC, MOV, EIGHTBPS) += fate-8bps
fate-8bps: CMD = framecrc -i $(SAMPLES)/8bps/full9iron-partial.mov -pix_fmt rgb24 fate-8bps: CMD = framecrc -i $(SAMPLES)/8bps/full9iron-partial.mov -pix_fmt rgb24
FATE_QT += fate-qdm2 FATE_QT-$(call DEMDEC, MOV, QDM2) += fate-qdm2
fate-qdm2: CMD = pcm -i $(SAMPLES)/qt-surge-suite/surge-2-16-B-QDM2.mov fate-qdm2: CMD = pcm -i $(SAMPLES)/qt-surge-suite/surge-2-16-B-QDM2.mov
fate-qdm2: CMP = oneoff fate-qdm2: CMP = oneoff
fate-qdm2: REF = $(SAMPLES)/qt-surge-suite/surge-2-16-B-QDM2.pcm fate-qdm2: REF = $(SAMPLES)/qt-surge-suite/surge-2-16-B-QDM2.pcm
fate-qdm2: FUZZ = 2 fate-qdm2: FUZZ = 2
FATE_QT += fate-qt-alaw-mono FATE_QT-$(call DEMDEC, MOV, PCM_ALAW) += fate-qt-alaw-mono
fate-qt-alaw-mono: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-1-16-B-alaw.mov -f s16le fate-qt-alaw-mono: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-1-16-B-alaw.mov -f s16le
FATE_QT += fate-qt-alaw-stereo FATE_QT-$(call DEMDEC, MOV, PCM_ALAW) += fate-qt-alaw-stereo
fate-qt-alaw-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-16-B-alaw.mov -f s16le fate-qt-alaw-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-16-B-alaw.mov -f s16le
FATE_QT += fate-qt-ima4-mono FATE_QT-$(call DEMDEC, MOV, ADPCM_IMA_QT) += fate-qt-ima4-mono
fate-qt-ima4-mono: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-1-16-B-ima4.mov -f s16le fate-qt-ima4-mono: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-1-16-B-ima4.mov -f s16le
FATE_QT += fate-qt-ima4-stereo FATE_QT-$(call DEMDEC, MOV, ADPCM_IMA_QT) += fate-qt-ima4-stereo
fate-qt-ima4-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-16-B-ima4.mov -f s16le fate-qt-ima4-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-16-B-ima4.mov -f s16le
FATE_QT += fate-qt-mac3-mono FATE_QT-$(call DEMDEC, MOV, MACE3) += fate-qt-mac3-mono
fate-qt-mac3-mono: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-1-8-MAC3.mov -f s16le fate-qt-mac3-mono: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-1-8-MAC3.mov -f s16le
FATE_QT += fate-qt-mac3-stereo FATE_QT-$(call DEMDEC, MOV, MACE3) += fate-qt-mac3-stereo
fate-qt-mac3-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-8-MAC3.mov -f s16le fate-qt-mac3-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-8-MAC3.mov -f s16le
FATE_QT += fate-qt-mac6-mono FATE_QT-$(call DEMDEC, MOV, MACE6) += fate-qt-mac6-mono
fate-qt-mac6-mono: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-1-8-MAC6.mov -f s16le fate-qt-mac6-mono: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-1-8-MAC6.mov -f s16le
FATE_QT += fate-qt-mac6-stereo FATE_QT-$(call DEMDEC, MOV, MACE6) += fate-qt-mac6-stereo
fate-qt-mac6-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-8-MAC6.mov -f s16le fate-qt-mac6-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-8-MAC6.mov -f s16le
FATE_QT += fate-qt-ulaw-mono FATE_QT-$(call DEMDEC, MOV, PCM_MULAW) += fate-qt-ulaw-mono
fate-qt-ulaw-mono: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-1-16-B-ulaw.mov -f s16le fate-qt-ulaw-mono: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-1-16-B-ulaw.mov -f s16le
FATE_QT += fate-qt-ulaw-stereo FATE_QT-$(call DEMDEC, MOV, PCM_MULAW) += fate-qt-ulaw-stereo
fate-qt-ulaw-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-16-B-ulaw.mov -f s16le fate-qt-ulaw-stereo: CMD = md5 -i $(SAMPLES)/qt-surge-suite/surge-2-16-B-ulaw.mov -f s16le
FATE_QT += fate-quickdraw FATE_QT-$(call DEMDEC, MOV, QDRAW) += fate-quickdraw
fate-quickdraw: CMD = framecrc -i $(SAMPLES)/quickdraw/Airplane.mov -pix_fmt rgb24 fate-quickdraw: CMD = framecrc -i $(SAMPLES)/quickdraw/Airplane.mov -pix_fmt rgb24
FATE_QT += fate-rpza FATE_QT-$(call DEMDEC, MOV, RPZA) += fate-rpza
fate-rpza: CMD = framecrc -i $(SAMPLES)/rpza/rpza2.mov -t 2 -pix_fmt rgb24 fate-rpza: CMD = framecrc -i $(SAMPLES)/rpza/rpza2.mov -t 2 -pix_fmt rgb24
FATE_QT += fate-svq1 FATE_QT-$(call DEMDEC, MOV, SVQ1) += fate-svq1
fate-svq1: CMD = framecrc -i $(SAMPLES)/svq1/marymary-shackles.mov -an -t 10 fate-svq1: CMD = framecrc -i $(SAMPLES)/svq1/marymary-shackles.mov -an -t 10
FATE_QT-$(CONFIG_ZLIB) += fate-svq3 FATE_QT-$(call ALLYES, MOV_DEMUXER SVQ3_DECODER ZLIB) += fate-svq3
fate-svq3: CMD = framecrc -i $(SAMPLES)/svq3/Vertical400kbit.sorenson3.mov -t 6 -an fate-svq3: CMD = framecrc -i $(SAMPLES)/svq3/Vertical400kbit.sorenson3.mov -t 6 -an
FATE_QT += $(FATE_QT-yes) FATE_QT += $(FATE_QT-yes)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment