* qatar/master: (22 commits)
rv34: frame-level multi-threading
mpegvideo: claim ownership of referenced pictures
aacsbr: prevent out of bounds memcpy().
ipmovie: fix pts for CODEC_ID_INTERPLAY_DPCM
sierravmd: fix audio pts
bethsoftvideo: Use bytestream2 functions to prevent buffer overreads.
bmpenc: support for PIX_FMT_RGB444
swscale: fix crash in fast_bilinear code when compiled with -mred-zone.
swscale: specify register type.
rv34: use get_bits_left()
avconv: reinitialize the filtergraph on resolution change.
vsrc_buffer: error on changing frame parameters.
avconv: fix -copyinkf.
fate: Update file checksums after the mov muxer change in a78dbada55d6
movenc: Don't store a nonzero creation time if nothing was set by the caller
bmpdec: support for rgb444 with bitfields compression
rgb2rgb: allow conversion for <15 bpp
doc: fix stray reference to FFmpeg
v4l2: use C99 struct initializer
v4l2: poll the file descriptor
...
Conflicts:
avconv.c
libavcodec/aacsbr.c
libavcodec/bethsoftvideo.c
libavcodec/kmvc.c
libavdevice/v4l2.c
libavfilter/vsrc_buffer.c
libswscale/swscale_unscaled.c
libswscale/x86/input.asm
tests/ref/acodec/alac
tests/ref/acodec/pcm_s16be
tests/ref/acodec/pcm_s24be
tests/ref/acodec/pcm_s32be
tests/ref/acodec/pcm_s8
tests/ref/lavf/mov
tests/ref/vsynth1/dnxhd_1080i
tests/ref/vsynth1/mpeg4
tests/ref/vsynth1/qtrle
tests/ref/vsynth1/svq1
tests/ref/vsynth2/dnxhd_1080i
tests/ref/vsynth2/mpeg4
tests/ref/vsynth2/qtrle
tests/ref/vsynth2/svq1
Merged-by: Michael Niedermayer <michaelni@gmx.at>
| ... | ... |
@@ -638,7 +638,6 @@ static int configure_video_filters(InputStream *ist, OutputStream *ost) |
| 638 | 638 |
|
| 639 | 639 |
if ((ret = avfilter_graph_parse(ost->graph, ost->avfilter, &inputs, &outputs, NULL)) < 0) |
| 640 | 640 |
return ret; |
| 641 |
- av_freep(&ost->avfilter); |
|
| 642 | 641 |
} else {
|
| 643 | 642 |
if ((ret = avfilter_link(last_filter, 0, ost->output_video_filter, 0)) < 0) |
| 644 | 643 |
return ret; |
| ... | ... |
@@ -767,6 +766,10 @@ void exit_program(int ret) |
| 767 | 767 |
bsfc = next; |
| 768 | 768 |
} |
| 769 | 769 |
output_streams[i].bitstream_filters = NULL; |
| 770 |
+ |
|
| 771 |
+#if CONFIG_AVFILTER |
|
| 772 |
+ av_freep(&output_streams[i].avfilter); |
|
| 773 |
+#endif |
|
| 770 | 774 |
} |
| 771 | 775 |
for (i = 0; i < nb_input_files; i++) {
|
| 772 | 776 |
avformat_close_input(&input_files[i].ctx); |
| ... | ... |
@@ -1302,6 +1305,7 @@ static void do_subtitle_out(AVFormatContext *s, |
| 1302 | 1302 |
static int bit_buffer_size = 1024 * 256; |
| 1303 | 1303 |
static uint8_t *bit_buffer = NULL; |
| 1304 | 1304 |
|
| 1305 |
+#if !CONFIG_AVFILTER |
|
| 1305 | 1306 |
static void do_video_resample(OutputStream *ost, |
| 1306 | 1307 |
InputStream *ist, |
| 1307 | 1308 |
AVFrame *in_picture, |
| ... | ... |
@@ -1316,7 +1320,6 @@ static void do_video_resample(OutputStream *ost, |
| 1316 | 1316 |
ost->resample_height != dec->height || |
| 1317 | 1317 |
ost->resample_pix_fmt != dec->pix_fmt; |
| 1318 | 1318 |
|
| 1319 |
-#if !CONFIG_AVFILTER |
|
| 1320 | 1319 |
if (resample_changed) {
|
| 1321 | 1320 |
av_log(NULL, AV_LOG_INFO, |
| 1322 | 1321 |
"Input stream #%d:%d frame changed from size:%dx%d fmt:%s to size:%dx%d fmt:%s\n", |
| ... | ... |
@@ -1332,6 +1335,7 @@ static void do_video_resample(OutputStream *ost, |
| 1332 | 1332 |
dec->height != enc->height || |
| 1333 | 1333 |
dec->pix_fmt != enc->pix_fmt; |
| 1334 | 1334 |
|
| 1335 |
+ |
|
| 1335 | 1336 |
if (ost->video_resample) {
|
| 1336 | 1337 |
*out_picture = &ost->resample_frame; |
| 1337 | 1338 |
if (!ost->img_resample_ctx || resample_changed) {
|
| ... | ... |
@@ -1357,21 +1361,13 @@ static void do_video_resample(OutputStream *ost, |
| 1357 | 1357 |
sws_scale(ost->img_resample_ctx, in_picture->data, in_picture->linesize, |
| 1358 | 1358 |
0, ost->resample_height, (*out_picture)->data, (*out_picture)->linesize); |
| 1359 | 1359 |
} |
| 1360 |
-#else |
|
| 1361 |
- if (resample_changed) {
|
|
| 1362 |
- avfilter_graph_free(&ost->graph); |
|
| 1363 |
- if (configure_video_filters(ist, ost)) {
|
|
| 1364 |
- av_log(NULL, AV_LOG_FATAL, "Error reinitializing filters!\n"); |
|
| 1365 |
- exit_program(1); |
|
| 1366 |
- } |
|
| 1367 |
- } |
|
| 1368 |
-#endif |
|
| 1369 | 1360 |
if (resample_changed) {
|
| 1370 | 1361 |
ost->resample_width = dec->width; |
| 1371 | 1362 |
ost->resample_height = dec->height; |
| 1372 | 1363 |
ost->resample_pix_fmt = dec->pix_fmt; |
| 1373 | 1364 |
} |
| 1374 | 1365 |
} |
| 1366 |
+#endif |
|
| 1375 | 1367 |
|
| 1376 | 1368 |
|
| 1377 | 1369 |
static void do_video_out(AVFormatContext *s, |
| ... | ... |
@@ -1426,7 +1422,11 @@ static void do_video_out(AVFormatContext *s, |
| 1426 | 1426 |
if (nb_frames <= 0) |
| 1427 | 1427 |
return; |
| 1428 | 1428 |
|
| 1429 |
+#if !CONFIG_AVFILTER |
|
| 1429 | 1430 |
do_video_resample(ost, ist, in_picture, &final_picture); |
| 1431 |
+#else |
|
| 1432 |
+ final_picture = in_picture; |
|
| 1433 |
+#endif |
|
| 1430 | 1434 |
|
| 1431 | 1435 |
/* duplicates frame if needed */ |
| 1432 | 1436 |
for (i = 0; i < nb_frames; i++) {
|
| ... | ... |
@@ -2012,12 +2012,33 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int |
| 2012 | 2012 |
|
| 2013 | 2013 |
for (i = 0; i < nb_output_streams; i++) {
|
| 2014 | 2014 |
OutputStream *ost = &output_streams[i]; |
| 2015 |
- int frame_size; |
|
| 2015 |
+ int frame_size, resample_changed; |
|
| 2016 | 2016 |
|
| 2017 | 2017 |
if (!check_output_constraints(ist, ost) || !ost->encoding_needed) |
| 2018 | 2018 |
continue; |
| 2019 | 2019 |
|
| 2020 | 2020 |
#if CONFIG_AVFILTER |
| 2021 |
+ resample_changed = ost->resample_width != decoded_frame->width || |
|
| 2022 |
+ ost->resample_height != decoded_frame->height || |
|
| 2023 |
+ ost->resample_pix_fmt != decoded_frame->format; |
|
| 2024 |
+ if (resample_changed) {
|
|
| 2025 |
+ av_log(NULL, AV_LOG_INFO, |
|
| 2026 |
+ "Input stream #%d:%d frame changed from size:%dx%d fmt:%s to size:%dx%d fmt:%s\n", |
|
| 2027 |
+ ist->file_index, ist->st->index, |
|
| 2028 |
+ ost->resample_width, ost->resample_height, av_get_pix_fmt_name(ost->resample_pix_fmt), |
|
| 2029 |
+ decoded_frame->width, decoded_frame->height, av_get_pix_fmt_name(decoded_frame->format)); |
|
| 2030 |
+ |
|
| 2031 |
+ avfilter_graph_free(&ost->graph); |
|
| 2032 |
+ if (configure_video_filters(ist, ost)) {
|
|
| 2033 |
+ av_log(NULL, AV_LOG_FATAL, "Error reinitializing filters!\n"); |
|
| 2034 |
+ exit_program(1); |
|
| 2035 |
+ } |
|
| 2036 |
+ |
|
| 2037 |
+ ost->resample_width = decoded_frame->width; |
|
| 2038 |
+ ost->resample_height = decoded_frame->height; |
|
| 2039 |
+ ost->resample_pix_fmt = decoded_frame->format; |
|
| 2040 |
+ } |
|
| 2041 |
+ |
|
| 2021 | 2042 |
if (!decoded_frame->sample_aspect_ratio.num) |
| 2022 | 2043 |
decoded_frame->sample_aspect_ratio = ist->st->sample_aspect_ratio; |
| 2023 | 2044 |
decoded_frame->pts = ist->pts; |
| ... | ... |
@@ -3736,13 +3757,13 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc) |
| 3736 | 3736 |
ost->top_field_first = -1; |
| 3737 | 3737 |
MATCH_PER_STREAM_OPT(top_field_first, i, ost->top_field_first, oc, st); |
| 3738 | 3738 |
|
| 3739 |
- MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, ost->copy_initial_nonkeyframes, oc ,st); |
|
| 3740 |
- |
|
| 3741 | 3739 |
#if CONFIG_AVFILTER |
| 3742 | 3740 |
MATCH_PER_STREAM_OPT(filters, str, filters, oc, st); |
| 3743 | 3741 |
if (filters) |
| 3744 | 3742 |
ost->avfilter = av_strdup(filters); |
| 3745 | 3743 |
#endif |
| 3744 |
+ } else {
|
|
| 3745 |
+ MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, ost->copy_initial_nonkeyframes, oc ,st); |
|
| 3746 | 3746 |
} |
| 3747 | 3747 |
|
| 3748 | 3748 |
return ost; |
| ... | ... |
@@ -1092,7 +1092,7 @@ drawbox=10:20:200:60:red@@0.5" |
| 1092 | 1092 |
Draw text string or text from specified file on top of video using the |
| 1093 | 1093 |
libfreetype library. |
| 1094 | 1094 |
|
| 1095 |
-To enable compilation of this filter you need to configure FFmpeg with |
|
| 1095 |
+To enable compilation of this filter you need to configure Libav with |
|
| 1096 | 1096 |
@code{--enable-libfreetype}.
|
| 1097 | 1097 |
|
| 1098 | 1098 |
The filter also recognizes strftime() sequences in the provided text |
| ... | ... |
@@ -4042,13 +4042,13 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc) |
| 4042 | 4042 |
ost->top_field_first = -1; |
| 4043 | 4043 |
MATCH_PER_STREAM_OPT(top_field_first, i, ost->top_field_first, oc, st); |
| 4044 | 4044 |
|
| 4045 |
- MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, ost->copy_initial_nonkeyframes, oc ,st); |
|
| 4046 |
- |
|
| 4047 | 4045 |
#if CONFIG_AVFILTER |
| 4048 | 4046 |
MATCH_PER_STREAM_OPT(filters, str, filters, oc, st); |
| 4049 | 4047 |
if (filters) |
| 4050 | 4048 |
ost->avfilter = av_strdup(filters); |
| 4051 | 4049 |
#endif |
| 4050 |
+ } else {
|
|
| 4051 |
+ MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, ost->copy_initial_nonkeyframes, oc ,st); |
|
| 4052 | 4052 |
} |
| 4053 | 4053 |
|
| 4054 | 4054 |
return ost; |
| ... | ... |
@@ -1185,14 +1185,15 @@ static void sbr_qmf_synthesis(DSPContext *dsp, FFTContext *mdct, |
| 1185 | 1185 |
{
|
| 1186 | 1186 |
int i, n; |
| 1187 | 1187 |
const float *sbr_qmf_window = div ? sbr_qmf_window_ds : sbr_qmf_window_us; |
| 1188 |
+ const int step = 128 >> div; |
|
| 1188 | 1189 |
float *v; |
| 1189 | 1190 |
for (i = 0; i < 32; i++) {
|
| 1190 |
- if (*v_off < 128 >> div) {
|
|
| 1191 |
+ if (*v_off < step) {
|
|
| 1191 | 1192 |
int saved_samples = (1280 - 128) >> div; |
| 1192 | 1193 |
memcpy(&v0[SBR_SYNTHESIS_BUF_SIZE - saved_samples], v0, saved_samples * sizeof(float)); |
| 1193 |
- *v_off = SBR_SYNTHESIS_BUF_SIZE - saved_samples - (128 >> div); |
|
| 1194 |
+ *v_off = SBR_SYNTHESIS_BUF_SIZE - saved_samples - step; |
|
| 1194 | 1195 |
} else {
|
| 1195 |
- *v_off -= 128 >> div; |
|
| 1196 |
+ *v_off -= step; |
|
| 1196 | 1197 |
} |
| 1197 | 1198 |
v = v0 + *v_off; |
| 1198 | 1199 |
if (div) {
|
| ... | ... |
@@ -34,6 +34,7 @@ |
| 34 | 34 |
|
| 35 | 35 |
typedef struct BethsoftvidContext {
|
| 36 | 36 |
AVFrame frame; |
| 37 |
+ GetByteContext g; |
|
| 37 | 38 |
} BethsoftvidContext; |
| 38 | 39 |
|
| 39 | 40 |
static av_cold int bethsoftvid_decode_init(AVCodecContext *avctx) |
| ... | ... |
@@ -47,19 +48,19 @@ static av_cold int bethsoftvid_decode_init(AVCodecContext *avctx) |
| 47 | 47 |
return 0; |
| 48 | 48 |
} |
| 49 | 49 |
|
| 50 |
-static int set_palette(AVFrame * frame, const uint8_t * palette_buffer, int buf_size) |
|
| 50 |
+static int set_palette(BethsoftvidContext *ctx) |
|
| 51 | 51 |
{
|
| 52 |
- uint32_t * palette = (uint32_t *)frame->data[1]; |
|
| 52 |
+ uint32_t *palette = (uint32_t *)ctx->frame.data[1]; |
|
| 53 | 53 |
int a; |
| 54 | 54 |
|
| 55 |
- if (buf_size < 256*3) |
|
| 55 |
+ if (bytestream2_get_bytes_left(&ctx->g) < 256*3) |
|
| 56 | 56 |
return AVERROR_INVALIDDATA; |
| 57 | 57 |
|
| 58 | 58 |
for(a = 0; a < 256; a++){
|
| 59 |
- palette[a] = 0xFF << 24 | AV_RB24(&palette_buffer[a * 3]) * 4; |
|
| 59 |
+ palette[a] = 0xFFU << 24 | bytestream2_get_be24u(&ctx->g) * 4; |
|
| 60 | 60 |
palette[a] |= palette[a] >> 6 & 0x30303; |
| 61 | 61 |
} |
| 62 |
- frame->palette_has_changed = 1; |
|
| 62 |
+ ctx->frame.palette_has_changed = 1; |
|
| 63 | 63 |
return 256*3; |
| 64 | 64 |
} |
| 65 | 65 |
|
| ... | ... |
@@ -67,8 +68,6 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx, |
| 67 | 67 |
void *data, int *data_size, |
| 68 | 68 |
AVPacket *avpkt) |
| 69 | 69 |
{
|
| 70 |
- const uint8_t *buf = avpkt->data; |
|
| 71 |
- int buf_size = avpkt->size; |
|
| 72 | 70 |
BethsoftvidContext * vid = avctx->priv_data; |
| 73 | 71 |
char block_type; |
| 74 | 72 |
uint8_t * dst; |
| ... | ... |
@@ -82,29 +81,32 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx, |
| 82 | 82 |
av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); |
| 83 | 83 |
return -1; |
| 84 | 84 |
} |
| 85 |
+ |
|
| 86 |
+ bytestream2_init(&vid->g, avpkt->data, avpkt->size); |
|
| 85 | 87 |
dst = vid->frame.data[0]; |
| 86 | 88 |
frame_end = vid->frame.data[0] + vid->frame.linesize[0] * avctx->height; |
| 87 | 89 |
|
| 88 |
- switch(block_type = *buf++){
|
|
| 89 |
- case PALETTE_BLOCK: |
|
| 90 |
- return set_palette(&vid->frame, buf, buf_size); |
|
| 90 |
+ switch(block_type = bytestream2_get_byte(&vid->g)){
|
|
| 91 |
+ case PALETTE_BLOCK: {
|
|
| 92 |
+ return set_palette(vid); |
|
| 93 |
+ } |
|
| 91 | 94 |
case VIDEO_YOFF_P_FRAME: |
| 92 |
- yoffset = bytestream_get_le16(&buf); |
|
| 95 |
+ yoffset = bytestream2_get_le16(&vid->g); |
|
| 93 | 96 |
if(yoffset >= avctx->height) |
| 94 | 97 |
return -1; |
| 95 | 98 |
dst += vid->frame.linesize[0] * yoffset; |
| 96 | 99 |
} |
| 97 | 100 |
|
| 98 | 101 |
// main code |
| 99 |
- while((code = *buf++)){
|
|
| 102 |
+ while((code = bytestream2_get_byte(&vid->g))){
|
|
| 100 | 103 |
int length = code & 0x7f; |
| 101 | 104 |
|
| 102 | 105 |
// copy any bytes starting at the current position, and ending at the frame width |
| 103 | 106 |
while(length > remaining){
|
| 104 | 107 |
if(code < 0x80) |
| 105 |
- bytestream_get_buffer(&buf, dst, remaining); |
|
| 108 |
+ bytestream2_get_buffer(&vid->g, dst, remaining); |
|
| 106 | 109 |
else if(block_type == VIDEO_I_FRAME) |
| 107 |
- memset(dst, buf[0], remaining); |
|
| 110 |
+ memset(dst, bytestream2_peek_byte(&vid->g), remaining); |
|
| 108 | 111 |
length -= remaining; // decrement the number of bytes to be copied |
| 109 | 112 |
dst += remaining + wrap_to_next_line; // skip over extra bytes at end of frame |
| 110 | 113 |
remaining = avctx->width; |
| ... | ... |
@@ -114,9 +116,9 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx, |
| 114 | 114 |
|
| 115 | 115 |
// copy any remaining bytes after / if line overflows |
| 116 | 116 |
if(code < 0x80) |
| 117 |
- bytestream_get_buffer(&buf, dst, length); |
|
| 117 |
+ bytestream2_get_buffer(&vid->g, dst, length); |
|
| 118 | 118 |
else if(block_type == VIDEO_I_FRAME) |
| 119 |
- memset(dst, *buf++, length); |
|
| 119 |
+ memset(dst, bytestream2_get_byte(&vid->g), length); |
|
| 120 | 120 |
remaining -= length; |
| 121 | 121 |
dst += length; |
| 122 | 122 |
} |
| ... | ... |
@@ -125,7 +127,7 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx, |
| 125 | 125 |
*data_size = sizeof(AVFrame); |
| 126 | 126 |
*(AVFrame*)data = vid->frame; |
| 127 | 127 |
|
| 128 |
- return buf_size; |
|
| 128 |
+ return avpkt->size; |
|
| 129 | 129 |
} |
| 130 | 130 |
|
| 131 | 131 |
static av_cold int bethsoftvid_decode_end(AVCodecContext *avctx) |
| ... | ... |
@@ -46,6 +46,7 @@ typedef struct KmvcContext {
|
| 46 | 46 |
uint32_t pal[256]; |
| 47 | 47 |
uint8_t *cur, *prev; |
| 48 | 48 |
uint8_t *frm0, *frm1; |
| 49 |
+ GetByteContext g; |
|
| 49 | 50 |
} KmvcContext; |
| 50 | 51 |
|
| 51 | 52 |
typedef struct BitBuf {
|
| ... | ... |
@@ -55,23 +56,19 @@ typedef struct BitBuf {
|
| 55 | 55 |
|
| 56 | 56 |
#define BLK(data, x, y) data[(x) + (y) * 320] |
| 57 | 57 |
|
| 58 |
-#define kmvc_init_getbits(bb, src) bb.bits = 7; bb.bitbuf = *src++; |
|
| 58 |
+#define kmvc_init_getbits(bb, g) bb.bits = 7; bb.bitbuf = bytestream2_get_byte(g); |
|
| 59 | 59 |
|
| 60 |
-#define kmvc_getbit(bb, src, src_end, res) {\
|
|
| 60 |
+#define kmvc_getbit(bb, g, res) {\
|
|
| 61 | 61 |
res = 0; \ |
| 62 | 62 |
if (bb.bitbuf & (1 << bb.bits)) res = 1; \ |
| 63 | 63 |
bb.bits--; \ |
| 64 | 64 |
if(bb.bits == -1) { \
|
| 65 |
- if (src >= src_end) { \
|
|
| 66 |
- av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n"); \ |
|
| 67 |
- return AVERROR_INVALIDDATA; \ |
|
| 68 |
- } \ |
|
| 69 |
- bb.bitbuf = *src++; \ |
|
| 65 |
+ bb.bitbuf = bytestream2_get_byte(g); \ |
|
| 70 | 66 |
bb.bits = 7; \ |
| 71 | 67 |
} \ |
| 72 | 68 |
} |
| 73 | 69 |
|
| 74 |
-static int kmvc_decode_intra_8x8(KmvcContext * ctx, const uint8_t * src, int src_size, int w, int h) |
|
| 70 |
+static int kmvc_decode_intra_8x8(KmvcContext * ctx, int w, int h) |
|
| 75 | 71 |
{
|
| 76 | 72 |
BitBuf bb; |
| 77 | 73 |
int res, val; |
| ... | ... |
@@ -79,42 +76,33 @@ static int kmvc_decode_intra_8x8(KmvcContext * ctx, const uint8_t * src, int src |
| 79 | 79 |
int bx, by; |
| 80 | 80 |
int l0x, l1x, l0y, l1y; |
| 81 | 81 |
int mx, my; |
| 82 |
- const uint8_t *src_end = src + src_size; |
|
| 83 | 82 |
|
| 84 |
- kmvc_init_getbits(bb, src); |
|
| 83 |
+ kmvc_init_getbits(bb, &ctx->g); |
|
| 85 | 84 |
|
| 86 | 85 |
for (by = 0; by < h; by += 8) |
| 87 | 86 |
for (bx = 0; bx < w; bx += 8) {
|
| 88 |
- kmvc_getbit(bb, src, src_end, res); |
|
| 87 |
+ if (!bytestream2_get_bytes_left(&ctx->g)) {
|
|
| 88 |
+ av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n"); |
|
| 89 |
+ return AVERROR_INVALIDDATA; |
|
| 90 |
+ } |
|
| 91 |
+ kmvc_getbit(bb, &ctx->g, res); |
|
| 89 | 92 |
if (!res) { // fill whole 8x8 block
|
| 90 |
- if (src >= src_end) {
|
|
| 91 |
- av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n"); |
|
| 92 |
- return AVERROR_INVALIDDATA; |
|
| 93 |
- } |
|
| 94 |
- val = *src++; |
|
| 93 |
+ val = bytestream2_get_byte(&ctx->g); |
|
| 95 | 94 |
for (i = 0; i < 64; i++) |
| 96 | 95 |
BLK(ctx->cur, bx + (i & 0x7), by + (i >> 3)) = val; |
| 97 | 96 |
} else { // handle four 4x4 subblocks
|
| 98 | 97 |
for (i = 0; i < 4; i++) {
|
| 99 | 98 |
l0x = bx + (i & 1) * 4; |
| 100 | 99 |
l0y = by + (i & 2) * 2; |
| 101 |
- kmvc_getbit(bb, src, src_end, res); |
|
| 100 |
+ kmvc_getbit(bb, &ctx->g, res); |
|
| 102 | 101 |
if (!res) {
|
| 103 |
- kmvc_getbit(bb, src, src_end, res); |
|
| 102 |
+ kmvc_getbit(bb, &ctx->g, res); |
|
| 104 | 103 |
if (!res) { // fill whole 4x4 block
|
| 105 |
- if (src >= src_end) {
|
|
| 106 |
- av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n"); |
|
| 107 |
- return AVERROR_INVALIDDATA; |
|
| 108 |
- } |
|
| 109 |
- val = *src++; |
|
| 104 |
+ val = bytestream2_get_byte(&ctx->g); |
|
| 110 | 105 |
for (j = 0; j < 16; j++) |
| 111 | 106 |
BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) = val; |
| 112 | 107 |
} else { // copy block from already decoded place
|
| 113 |
- if (src >= src_end) {
|
|
| 114 |
- av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n"); |
|
| 115 |
- return AVERROR_INVALIDDATA; |
|
| 116 |
- } |
|
| 117 |
- val = *src++; |
|
| 108 |
+ val = bytestream2_get_byte(&ctx->g); |
|
| 118 | 109 |
mx = val & 0xF; |
| 119 | 110 |
my = val >> 4; |
| 120 | 111 |
for (j = 0; j < 16; j++) |
| ... | ... |
@@ -125,25 +113,17 @@ static int kmvc_decode_intra_8x8(KmvcContext * ctx, const uint8_t * src, int src |
| 125 | 125 |
for (j = 0; j < 4; j++) {
|
| 126 | 126 |
l1x = l0x + (j & 1) * 2; |
| 127 | 127 |
l1y = l0y + (j & 2); |
| 128 |
- kmvc_getbit(bb, src, src_end, res); |
|
| 128 |
+ kmvc_getbit(bb, &ctx->g, res); |
|
| 129 | 129 |
if (!res) {
|
| 130 |
- kmvc_getbit(bb, src, src_end, res); |
|
| 130 |
+ kmvc_getbit(bb, &ctx->g, res); |
|
| 131 | 131 |
if (!res) { // fill whole 2x2 block
|
| 132 |
- if (src >= src_end) {
|
|
| 133 |
- av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n"); |
|
| 134 |
- return AVERROR_INVALIDDATA; |
|
| 135 |
- } |
|
| 136 |
- val = *src++; |
|
| 132 |
+ val = bytestream2_get_byte(&ctx->g); |
|
| 137 | 133 |
BLK(ctx->cur, l1x, l1y) = val; |
| 138 | 134 |
BLK(ctx->cur, l1x + 1, l1y) = val; |
| 139 | 135 |
BLK(ctx->cur, l1x, l1y + 1) = val; |
| 140 | 136 |
BLK(ctx->cur, l1x + 1, l1y + 1) = val; |
| 141 | 137 |
} else { // copy block from already decoded place
|
| 142 |
- if (src >= src_end) {
|
|
| 143 |
- av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n"); |
|
| 144 |
- return AVERROR_INVALIDDATA; |
|
| 145 |
- } |
|
| 146 |
- val = *src++; |
|
| 138 |
+ val = bytestream2_get_byte(&ctx->g); |
|
| 147 | 139 |
mx = val & 0xF; |
| 148 | 140 |
my = val >> 4; |
| 149 | 141 |
BLK(ctx->cur, l1x, l1y) = BLK(ctx->cur, l1x - mx, l1y - my); |
| ... | ... |
@@ -155,10 +135,10 @@ static int kmvc_decode_intra_8x8(KmvcContext * ctx, const uint8_t * src, int src |
| 155 | 155 |
BLK(ctx->cur, l1x + 1 - mx, l1y + 1 - my); |
| 156 | 156 |
} |
| 157 | 157 |
} else { // read values for block
|
| 158 |
- BLK(ctx->cur, l1x, l1y) = *src++; |
|
| 159 |
- BLK(ctx->cur, l1x + 1, l1y) = *src++; |
|
| 160 |
- BLK(ctx->cur, l1x, l1y + 1) = *src++; |
|
| 161 |
- BLK(ctx->cur, l1x + 1, l1y + 1) = *src++; |
|
| 158 |
+ BLK(ctx->cur, l1x, l1y) = bytestream2_get_byte(&ctx->g); |
|
| 159 |
+ BLK(ctx->cur, l1x + 1, l1y) = bytestream2_get_byte(&ctx->g); |
|
| 160 |
+ BLK(ctx->cur, l1x, l1y + 1) = bytestream2_get_byte(&ctx->g); |
|
| 161 |
+ BLK(ctx->cur, l1x + 1, l1y + 1) = bytestream2_get_byte(&ctx->g); |
|
| 162 | 162 |
} |
| 163 | 163 |
} |
| 164 | 164 |
} |
| ... | ... |
@@ -169,7 +149,7 @@ static int kmvc_decode_intra_8x8(KmvcContext * ctx, const uint8_t * src, int src |
| 169 | 169 |
return 0; |
| 170 | 170 |
} |
| 171 | 171 |
|
| 172 |
-static int kmvc_decode_inter_8x8(KmvcContext * ctx, const uint8_t * src, int src_size, int w, int h) |
|
| 172 |
+static int kmvc_decode_inter_8x8(KmvcContext * ctx, int w, int h) |
|
| 173 | 173 |
{
|
| 174 | 174 |
BitBuf bb; |
| 175 | 175 |
int res, val; |
| ... | ... |
@@ -177,21 +157,20 @@ static int kmvc_decode_inter_8x8(KmvcContext * ctx, const uint8_t * src, int src |
| 177 | 177 |
int bx, by; |
| 178 | 178 |
int l0x, l1x, l0y, l1y; |
| 179 | 179 |
int mx, my; |
| 180 |
- const uint8_t *src_end = src + src_size; |
|
| 181 | 180 |
|
| 182 |
- kmvc_init_getbits(bb, src); |
|
| 181 |
+ kmvc_init_getbits(bb, &ctx->g); |
|
| 183 | 182 |
|
| 184 | 183 |
for (by = 0; by < h; by += 8) |
| 185 | 184 |
for (bx = 0; bx < w; bx += 8) {
|
| 186 |
- kmvc_getbit(bb, src, src_end, res); |
|
| 185 |
+ kmvc_getbit(bb, &ctx->g, res); |
|
| 187 | 186 |
if (!res) {
|
| 188 |
- kmvc_getbit(bb, src, src_end, res); |
|
| 187 |
+ kmvc_getbit(bb, &ctx->g, res); |
|
| 189 | 188 |
if (!res) { // fill whole 8x8 block
|
| 190 |
- if (src >= src_end) {
|
|
| 189 |
+ if (!bytestream2_get_bytes_left(&ctx->g)) {
|
|
| 191 | 190 |
av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n"); |
| 192 | 191 |
return AVERROR_INVALIDDATA; |
| 193 | 192 |
} |
| 194 |
- val = *src++; |
|
| 193 |
+ val = bytestream2_get_byte(&ctx->g); |
|
| 195 | 194 |
for (i = 0; i < 64; i++) |
| 196 | 195 |
BLK(ctx->cur, bx + (i & 0x7), by + (i >> 3)) = val; |
| 197 | 196 |
} else { // copy block from previous frame
|
| ... | ... |
@@ -200,26 +179,22 @@ static int kmvc_decode_inter_8x8(KmvcContext * ctx, const uint8_t * src, int src |
| 200 | 200 |
BLK(ctx->prev, bx + (i & 0x7), by + (i >> 3)); |
| 201 | 201 |
} |
| 202 | 202 |
} else { // handle four 4x4 subblocks
|
| 203 |
+ if (!bytestream2_get_bytes_left(&ctx->g)) {
|
|
| 204 |
+ av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n"); |
|
| 205 |
+ return AVERROR_INVALIDDATA; |
|
| 206 |
+ } |
|
| 203 | 207 |
for (i = 0; i < 4; i++) {
|
| 204 | 208 |
l0x = bx + (i & 1) * 4; |
| 205 | 209 |
l0y = by + (i & 2) * 2; |
| 206 |
- kmvc_getbit(bb, src, src_end, res); |
|
| 210 |
+ kmvc_getbit(bb, &ctx->g, res); |
|
| 207 | 211 |
if (!res) {
|
| 208 |
- kmvc_getbit(bb, src, src_end, res); |
|
| 212 |
+ kmvc_getbit(bb, &ctx->g, res); |
|
| 209 | 213 |
if (!res) { // fill whole 4x4 block
|
| 210 |
- if (src >= src_end) {
|
|
| 211 |
- av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n"); |
|
| 212 |
- return AVERROR_INVALIDDATA; |
|
| 213 |
- } |
|
| 214 |
- val = *src++; |
|
| 214 |
+ val = bytestream2_get_byte(&ctx->g); |
|
| 215 | 215 |
for (j = 0; j < 16; j++) |
| 216 | 216 |
BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) = val; |
| 217 | 217 |
} else { // copy block
|
| 218 |
- if (src >= src_end) {
|
|
| 219 |
- av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n"); |
|
| 220 |
- return AVERROR_INVALIDDATA; |
|
| 221 |
- } |
|
| 222 |
- val = *src++; |
|
| 218 |
+ val = bytestream2_get_byte(&ctx->g); |
|
| 223 | 219 |
mx = (val & 0xF) - 8; |
| 224 | 220 |
my = (val >> 4) - 8; |
| 225 | 221 |
for (j = 0; j < 16; j++) |
| ... | ... |
@@ -230,25 +205,17 @@ static int kmvc_decode_inter_8x8(KmvcContext * ctx, const uint8_t * src, int src |
| 230 | 230 |
for (j = 0; j < 4; j++) {
|
| 231 | 231 |
l1x = l0x + (j & 1) * 2; |
| 232 | 232 |
l1y = l0y + (j & 2); |
| 233 |
- kmvc_getbit(bb, src, src_end, res); |
|
| 233 |
+ kmvc_getbit(bb, &ctx->g, res); |
|
| 234 | 234 |
if (!res) {
|
| 235 |
- kmvc_getbit(bb, src, src_end, res); |
|
| 235 |
+ kmvc_getbit(bb, &ctx->g, res); |
|
| 236 | 236 |
if (!res) { // fill whole 2x2 block
|
| 237 |
- if (src >= src_end) {
|
|
| 238 |
- av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n"); |
|
| 239 |
- return AVERROR_INVALIDDATA; |
|
| 240 |
- } |
|
| 241 |
- val = *src++; |
|
| 237 |
+ val = bytestream2_get_byte(&ctx->g); |
|
| 242 | 238 |
BLK(ctx->cur, l1x, l1y) = val; |
| 243 | 239 |
BLK(ctx->cur, l1x + 1, l1y) = val; |
| 244 | 240 |
BLK(ctx->cur, l1x, l1y + 1) = val; |
| 245 | 241 |
BLK(ctx->cur, l1x + 1, l1y + 1) = val; |
| 246 | 242 |
} else { // copy block
|
| 247 |
- if (src >= src_end) {
|
|
| 248 |
- av_log(ctx->avctx, AV_LOG_ERROR, "Data overrun\n"); |
|
| 249 |
- return AVERROR_INVALIDDATA; |
|
| 250 |
- } |
|
| 251 |
- val = *src++; |
|
| 243 |
+ val = bytestream2_get_byte(&ctx->g); |
|
| 252 | 244 |
mx = (val & 0xF) - 8; |
| 253 | 245 |
my = (val >> 4) - 8; |
| 254 | 246 |
BLK(ctx->cur, l1x, l1y) = BLK(ctx->prev, l1x + mx, l1y + my); |
| ... | ... |
@@ -260,10 +227,10 @@ static int kmvc_decode_inter_8x8(KmvcContext * ctx, const uint8_t * src, int src |
| 260 | 260 |
BLK(ctx->prev, l1x + 1 + mx, l1y + 1 + my); |
| 261 | 261 |
} |
| 262 | 262 |
} else { // read values for block
|
| 263 |
- BLK(ctx->cur, l1x, l1y) = *src++; |
|
| 264 |
- BLK(ctx->cur, l1x + 1, l1y) = *src++; |
|
| 265 |
- BLK(ctx->cur, l1x, l1y + 1) = *src++; |
|
| 266 |
- BLK(ctx->cur, l1x + 1, l1y + 1) = *src++; |
|
| 263 |
+ BLK(ctx->cur, l1x, l1y) = bytestream2_get_byte(&ctx->g); |
|
| 264 |
+ BLK(ctx->cur, l1x + 1, l1y) = bytestream2_get_byte(&ctx->g); |
|
| 265 |
+ BLK(ctx->cur, l1x, l1y + 1) = bytestream2_get_byte(&ctx->g); |
|
| 266 |
+ BLK(ctx->cur, l1x + 1, l1y + 1) = bytestream2_get_byte(&ctx->g); |
|
| 267 | 267 |
} |
| 268 | 268 |
} |
| 269 | 269 |
} |
| ... | ... |
@@ -276,8 +243,6 @@ static int kmvc_decode_inter_8x8(KmvcContext * ctx, const uint8_t * src, int src |
| 276 | 276 |
|
| 277 | 277 |
static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPacket *avpkt) |
| 278 | 278 |
{
|
| 279 |
- const uint8_t *buf = avpkt->data; |
|
| 280 |
- int buf_size = avpkt->size; |
|
| 281 | 279 |
KmvcContext *const ctx = avctx->priv_data; |
| 282 | 280 |
uint8_t *out, *src; |
| 283 | 281 |
int i; |
| ... | ... |
@@ -285,6 +250,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa |
| 285 | 285 |
int blocksize; |
| 286 | 286 |
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL); |
| 287 | 287 |
|
| 288 |
+ bytestream2_init(&ctx->g, avpkt->data, avpkt->size); |
|
| 288 | 289 |
if (ctx->pic.data[0]) |
| 289 | 290 |
avctx->release_buffer(avctx, &ctx->pic); |
| 290 | 291 |
|
| ... | ... |
@@ -295,16 +261,16 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa |
| 295 | 295 |
return -1; |
| 296 | 296 |
} |
| 297 | 297 |
|
| 298 |
- header = *buf++; |
|
| 298 |
+ header = bytestream2_get_byte(&ctx->g); |
|
| 299 | 299 |
|
| 300 | 300 |
/* blocksize 127 is really palette change event */ |
| 301 |
- if (buf[0] == 127) {
|
|
| 302 |
- buf += 3; |
|
| 301 |
+ if (bytestream2_peek_byte(&ctx->g) == 127) {
|
|
| 302 |
+ bytestream2_skip(&ctx->g, 3); |
|
| 303 | 303 |
for (i = 0; i < 127; i++) {
|
| 304 |
- ctx->pal[i + (header & 0x81)] = 0xFF << 24 | AV_RB24(buf); |
|
| 305 |
- buf += 4; |
|
| 304 |
+ ctx->pal[i + (header & 0x81)] = 0xFFU << 24 | bytestream2_get_be24(&ctx->g); |
|
| 305 |
+ bytestream2_skip(&ctx->g, 1); |
|
| 306 | 306 |
} |
| 307 |
- buf -= 127 * 4 + 3; |
|
| 307 |
+ bytestream2_seek(&ctx->g, -127 * 4 - 3, SEEK_CUR); |
|
| 308 | 308 |
} |
| 309 | 309 |
|
| 310 | 310 |
if (header & KMVC_KEYFRAME) {
|
| ... | ... |
@@ -319,7 +285,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa |
| 319 | 319 |
ctx->pic.palette_has_changed = 1; |
| 320 | 320 |
// palette starts from index 1 and has 127 entries |
| 321 | 321 |
for (i = 1; i <= ctx->palsize; i++) {
|
| 322 |
- ctx->pal[i] = 0xFF << 24 | bytestream_get_be24(&buf); |
|
| 322 |
+ ctx->pal[i] = 0xFFU << 24 | bytestream2_get_be24(&ctx->g); |
|
| 323 | 323 |
} |
| 324 | 324 |
} |
| 325 | 325 |
|
| ... | ... |
@@ -336,7 +302,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa |
| 336 | 336 |
/* make the palette available on the way out */ |
| 337 | 337 |
memcpy(ctx->pic.data[1], ctx->pal, 1024); |
| 338 | 338 |
|
| 339 |
- blocksize = *buf++; |
|
| 339 |
+ blocksize = bytestream2_get_byte(&ctx->g); |
|
| 340 | 340 |
|
| 341 | 341 |
if (blocksize != 8 && blocksize != 127) {
|
| 342 | 342 |
av_log(avctx, AV_LOG_ERROR, "Block size = %i\n", blocksize); |
| ... | ... |
@@ -349,10 +315,10 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa |
| 349 | 349 |
memcpy(ctx->cur, ctx->prev, 320 * 200); |
| 350 | 350 |
break; |
| 351 | 351 |
case 3: |
| 352 |
- kmvc_decode_intra_8x8(ctx, buf, buf_size, avctx->width, avctx->height); |
|
| 352 |
+ kmvc_decode_intra_8x8(ctx, avctx->width, avctx->height); |
|
| 353 | 353 |
break; |
| 354 | 354 |
case 4: |
| 355 |
- kmvc_decode_inter_8x8(ctx, buf, buf_size, avctx->width, avctx->height); |
|
| 355 |
+ kmvc_decode_inter_8x8(ctx, avctx->width, avctx->height); |
|
| 356 | 356 |
break; |
| 357 | 357 |
default: |
| 358 | 358 |
av_log(avctx, AV_LOG_ERROR, "Unknown compression method %i\n", header & KMVC_METHOD); |
| ... | ... |
@@ -380,7 +346,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa |
| 380 | 380 |
*(AVFrame *) data = ctx->pic; |
| 381 | 381 |
|
| 382 | 382 |
/* always report that the buffer was completely consumed */ |
| 383 |
- return buf_size; |
|
| 383 |
+ return avpkt->size; |
|
| 384 | 384 |
} |
| 385 | 385 |
|
| 386 | 386 |
|
| ... | ... |
@@ -1135,25 +1135,26 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) |
| 1135 | 1135 |
s->codec_id == CODEC_ID_SVQ3); |
| 1136 | 1136 |
|
| 1137 | 1137 |
/* mark & release old frames */ |
| 1138 |
- if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr && |
|
| 1139 |
- s->last_picture_ptr != s->next_picture_ptr && |
|
| 1140 |
- s->last_picture_ptr->f.data[0]) {
|
|
| 1141 |
- if (s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3) {
|
|
| 1138 |
+ if (s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3) {
|
|
| 1139 |
+ if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr && |
|
| 1140 |
+ s->last_picture_ptr != s->next_picture_ptr && |
|
| 1141 |
+ s->last_picture_ptr->f.data[0]) {
|
|
| 1142 | 1142 |
if (s->last_picture_ptr->owner2 == s) |
| 1143 | 1143 |
free_frame_buffer(s, s->last_picture_ptr); |
| 1144 |
+ } |
|
| 1144 | 1145 |
|
| 1145 |
- /* release forgotten pictures */ |
|
| 1146 |
- /* if (mpeg124/h263) */ |
|
| 1147 |
- if (!s->encoding) {
|
|
| 1148 |
- for (i = 0; i < s->picture_count; i++) {
|
|
| 1149 |
- if (s->picture[i].owner2 == s && s->picture[i].f.data[0] && |
|
| 1150 |
- &s->picture[i] != s->next_picture_ptr && |
|
| 1151 |
- s->picture[i].f.reference) {
|
|
| 1152 |
- if (!(avctx->active_thread_type & FF_THREAD_FRAME)) |
|
| 1153 |
- av_log(avctx, AV_LOG_ERROR, |
|
| 1154 |
- "releasing zombie picture\n"); |
|
| 1155 |
- free_frame_buffer(s, &s->picture[i]); |
|
| 1156 |
- } |
|
| 1146 |
+ /* release forgotten pictures */ |
|
| 1147 |
+ /* if (mpeg124/h263) */ |
|
| 1148 |
+ if (!s->encoding) {
|
|
| 1149 |
+ for (i = 0; i < s->picture_count; i++) {
|
|
| 1150 |
+ if (s->picture[i].owner2 == s && s->picture[i].f.data[0] && |
|
| 1151 |
+ &s->picture[i] != s->last_picture_ptr && |
|
| 1152 |
+ &s->picture[i] != s->next_picture_ptr && |
|
| 1153 |
+ s->picture[i].f.reference) {
|
|
| 1154 |
+ if (!(avctx->active_thread_type & FF_THREAD_FRAME)) |
|
| 1155 |
+ av_log(avctx, AV_LOG_ERROR, |
|
| 1156 |
+ "releasing zombie picture\n"); |
|
| 1157 |
+ free_frame_buffer(s, &s->picture[i]); |
|
| 1157 | 1158 |
} |
| 1158 | 1159 |
} |
| 1159 | 1160 |
} |
| ... | ... |
@@ -1274,6 +1275,14 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) |
| 1274 | 1274 |
if (s->next_picture_ptr) |
| 1275 | 1275 |
ff_copy_picture(&s->next_picture, s->next_picture_ptr); |
| 1276 | 1276 |
|
| 1277 |
+ if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_FRAME) && |
|
| 1278 |
+ (s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3)) {
|
|
| 1279 |
+ if (s->next_picture_ptr) |
|
| 1280 |
+ s->next_picture_ptr->owner2 = s; |
|
| 1281 |
+ if (s->last_picture_ptr) |
|
| 1282 |
+ s->last_picture_ptr->owner2 = s; |
|
| 1283 |
+ } |
|
| 1284 |
+ |
|
| 1277 | 1285 |
assert(s->pict_type == AV_PICTURE_TYPE_I || (s->last_picture_ptr && |
| 1278 | 1286 |
s->last_picture_ptr->f.data[0])); |
| 1279 | 1287 |
|
| ... | ... |
@@ -279,8 +279,10 @@ AVCodec ff_rv30_decoder = {
|
| 279 | 279 |
.init = rv30_decode_init, |
| 280 | 280 |
.close = ff_rv34_decode_end, |
| 281 | 281 |
.decode = ff_rv34_decode_frame, |
| 282 |
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY, |
|
| 282 |
+ .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_FRAME_THREADS, |
|
| 283 | 283 |
.flush = ff_mpeg_flush, |
| 284 | 284 |
.long_name = NULL_IF_CONFIG_SMALL("RealVideo 3.0"),
|
| 285 | 285 |
.pix_fmts = ff_pixfmt_list_420, |
| 286 |
+ .init_thread_copy = ONLY_IF_THREADS_ENABLED(ff_rv34_decode_init_thread_copy), |
|
| 287 |
+ .update_thread_context = ONLY_IF_THREADS_ENABLED(ff_rv34_decode_update_thread_context), |
|
| 286 | 288 |
}; |
| ... | ... |
@@ -24,12 +24,16 @@ |
| 24 | 24 |
* RV30/40 decoder common data |
| 25 | 25 |
*/ |
| 26 | 26 |
|
| 27 |
+#include "libavutil/internal.h" |
|
| 28 |
+ |
|
| 27 | 29 |
#include "avcodec.h" |
| 28 | 30 |
#include "dsputil.h" |
| 29 | 31 |
#include "mpegvideo.h" |
| 30 | 32 |
#include "golomb.h" |
| 33 |
+#include "internal.h" |
|
| 31 | 34 |
#include "mathops.h" |
| 32 | 35 |
#include "rectangle.h" |
| 36 |
+#include "thread.h" |
|
| 33 | 37 |
|
| 34 | 38 |
#include "rv34vlc.h" |
| 35 | 39 |
#include "rv34data.h" |
| ... | ... |
@@ -669,6 +673,14 @@ static inline void rv34_mc(RV34DecContext *r, const int block_type, |
| 669 | 669 |
if(uvmx == 6 && uvmy == 6) |
| 670 | 670 |
uvmx = uvmy = 4; |
| 671 | 671 |
} |
| 672 |
+ |
|
| 673 |
+ if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) {
|
|
| 674 |
+ /* wait for the referenced mb row to be finished */ |
|
| 675 |
+ int mb_row = FFMIN(s->mb_height - 1, s->mb_y + ((yoff + my + 21) >> 4)); |
|
| 676 |
+ AVFrame *f = dir ? &s->next_picture_ptr->f : &s->last_picture_ptr->f; |
|
| 677 |
+ ff_thread_await_progress(f, mb_row, 0); |
|
| 678 |
+ } |
|
| 679 |
+ |
|
| 672 | 680 |
dxy = ly*4 + lx; |
| 673 | 681 |
srcY = dir ? s->next_picture_ptr->f.data[0] : s->last_picture_ptr->f.data[0]; |
| 674 | 682 |
srcU = dir ? s->next_picture_ptr->f.data[1] : s->last_picture_ptr->f.data[1]; |
| ... | ... |
@@ -824,6 +836,10 @@ static int rv34_decode_mv(RV34DecContext *r, int block_type) |
| 824 | 824 |
} |
| 825 | 825 |
case RV34_MB_B_DIRECT: |
| 826 | 826 |
//surprisingly, it uses motion scheme from next reference frame |
| 827 |
+ /* wait for the current mb row to be finished */ |
|
| 828 |
+ if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) |
|
| 829 |
+ ff_thread_await_progress(&s->next_picture_ptr->f, s->mb_y - 1, 0); |
|
| 830 |
+ |
|
| 827 | 831 |
next_bt = s->next_picture_ptr->f.mb_type[s->mb_x + s->mb_y * s->mb_stride]; |
| 828 | 832 |
if(IS_INTRA(next_bt) || IS_SKIP(next_bt)){
|
| 829 | 833 |
ZERO8x2(s->current_picture_ptr->f.motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); |
| ... | ... |
@@ -1186,7 +1202,7 @@ static int check_slice_end(RV34DecContext *r, MpegEncContext *s) |
| 1186 | 1186 |
return 1; |
| 1187 | 1187 |
if(r->s.mb_skip_run > 1) |
| 1188 | 1188 |
return 0; |
| 1189 |
- bits = r->bits - get_bits_count(&s->gb); |
|
| 1189 |
+ bits = get_bits_left(&s->gb); |
|
| 1190 | 1190 |
if(bits < 0 || (bits < 8 && !show_bits(&s->gb, bits))) |
| 1191 | 1191 |
return 1; |
| 1192 | 1192 |
return 0; |
| ... | ... |
@@ -1255,6 +1271,7 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int |
| 1255 | 1255 |
} |
| 1256 | 1256 |
} |
| 1257 | 1257 |
s->mb_x = s->mb_y = 0; |
| 1258 |
+ ff_thread_finish_setup(s->avctx); |
|
| 1258 | 1259 |
} else {
|
| 1259 | 1260 |
int slice_type = r->si.type ? r->si.type : AV_PICTURE_TYPE_I; |
| 1260 | 1261 |
|
| ... | ... |
@@ -1270,7 +1287,6 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int |
| 1270 | 1270 |
|
| 1271 | 1271 |
r->si.end = end; |
| 1272 | 1272 |
s->qscale = r->si.quant; |
| 1273 |
- r->bits = buf_size*8; |
|
| 1274 | 1273 |
s->mb_num_left = r->si.end - r->si.start; |
| 1275 | 1274 |
r->s.mb_skip_run = 0; |
| 1276 | 1275 |
|
| ... | ... |
@@ -1304,6 +1320,11 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int |
| 1304 | 1304 |
|
| 1305 | 1305 |
if(r->loop_filter && s->mb_y >= 2) |
| 1306 | 1306 |
r->loop_filter(r, s->mb_y - 2); |
| 1307 |
+ |
|
| 1308 |
+ if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) |
|
| 1309 |
+ ff_thread_report_progress(&s->current_picture_ptr->f, |
|
| 1310 |
+ s->mb_y - 2, 0); |
|
| 1311 |
+ |
|
| 1307 | 1312 |
} |
| 1308 | 1313 |
if(s->mb_x == s->resync_mb_x) |
| 1309 | 1314 |
s->first_slice_line=0; |
| ... | ... |
@@ -1369,6 +1390,71 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx) |
| 1369 | 1369 |
return 0; |
| 1370 | 1370 |
} |
| 1371 | 1371 |
|
| 1372 |
+int ff_rv34_decode_init_thread_copy(AVCodecContext *avctx) |
|
| 1373 |
+{
|
|
| 1374 |
+ RV34DecContext *r = avctx->priv_data; |
|
| 1375 |
+ |
|
| 1376 |
+ r->s.avctx = avctx; |
|
| 1377 |
+ |
|
| 1378 |
+ if (avctx->internal->is_copy) {
|
|
| 1379 |
+ r->cbp_chroma = av_malloc(r->s.mb_stride * r->s.mb_height * |
|
| 1380 |
+ sizeof(*r->cbp_chroma)); |
|
| 1381 |
+ r->cbp_luma = av_malloc(r->s.mb_stride * r->s.mb_height * |
|
| 1382 |
+ sizeof(*r->cbp_luma)); |
|
| 1383 |
+ r->deblock_coefs = av_malloc(r->s.mb_stride * r->s.mb_height * |
|
| 1384 |
+ sizeof(*r->deblock_coefs)); |
|
| 1385 |
+ r->intra_types_hist = av_malloc(r->intra_types_stride * 4 * 2 * |
|
| 1386 |
+ sizeof(*r->intra_types_hist)); |
|
| 1387 |
+ r->mb_type = av_malloc(r->s.mb_stride * r->s.mb_height * |
|
| 1388 |
+ sizeof(*r->mb_type)); |
|
| 1389 |
+ |
|
| 1390 |
+ if (!(r->cbp_chroma && r->cbp_luma && r->deblock_coefs && |
|
| 1391 |
+ r->intra_types_hist && r->mb_type)) {
|
|
| 1392 |
+ av_freep(&r->cbp_chroma); |
|
| 1393 |
+ av_freep(&r->cbp_luma); |
|
| 1394 |
+ av_freep(&r->deblock_coefs); |
|
| 1395 |
+ av_freep(&r->intra_types_hist); |
|
| 1396 |
+ av_freep(&r->mb_type); |
|
| 1397 |
+ r->intra_types = NULL; |
|
| 1398 |
+ return AVERROR(ENOMEM); |
|
| 1399 |
+ } |
|
| 1400 |
+ |
|
| 1401 |
+ r->intra_types = r->intra_types_hist + r->intra_types_stride * 4; |
|
| 1402 |
+ r->tmp_b_block_base = NULL; |
|
| 1403 |
+ |
|
| 1404 |
+ memset(r->mb_type, 0, r->s.mb_stride * r->s.mb_height * |
|
| 1405 |
+ sizeof(*r->mb_type)); |
|
| 1406 |
+ |
|
| 1407 |
+ MPV_common_init(&r->s); |
|
| 1408 |
+ } |
|
| 1409 |
+ return 0; |
|
| 1410 |
+} |
|
| 1411 |
+ |
|
| 1412 |
+int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src) |
|
| 1413 |
+{
|
|
| 1414 |
+ RV34DecContext *r = dst->priv_data, *r1 = src->priv_data; |
|
| 1415 |
+ MpegEncContext * const s = &r->s, * const s1 = &r1->s; |
|
| 1416 |
+ int err; |
|
| 1417 |
+ |
|
| 1418 |
+ if (dst == src || !s1->context_initialized) |
|
| 1419 |
+ return 0; |
|
| 1420 |
+ |
|
| 1421 |
+ if ((err = ff_mpeg_update_thread_context(dst, src))) |
|
| 1422 |
+ return err; |
|
| 1423 |
+ |
|
| 1424 |
+ r->cur_pts = r1->cur_pts; |
|
| 1425 |
+ r->last_pts = r1->last_pts; |
|
| 1426 |
+ r->next_pts = r1->next_pts; |
|
| 1427 |
+ |
|
| 1428 |
+ memset(&r->si, 0, sizeof(r->si)); |
|
| 1429 |
+ |
|
| 1430 |
+ /* necessary since it is it the condition checked for in decode_slice |
|
| 1431 |
+ * to call MPV_frame_start. cmp. comment at the end of decode_frame */ |
|
| 1432 |
+ s->current_picture_ptr = NULL; |
|
| 1433 |
+ |
|
| 1434 |
+ return 0; |
|
| 1435 |
+} |
|
| 1436 |
+ |
|
| 1372 | 1437 |
static int get_slice_offset(AVCodecContext *avctx, const uint8_t *buf, int n) |
| 1373 | 1438 |
{
|
| 1374 | 1439 |
if(avctx->slice_count) return avctx->slice_offset[n]; |
| ... | ... |
@@ -1470,6 +1556,9 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, |
| 1470 | 1470 |
if(last && s->current_picture_ptr){
|
| 1471 | 1471 |
if(r->loop_filter) |
| 1472 | 1472 |
r->loop_filter(r, s->mb_height - 1); |
| 1473 |
+ if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) |
|
| 1474 |
+ ff_thread_report_progress(&s->current_picture_ptr->f, |
|
| 1475 |
+ s->mb_height - 1, 0); |
|
| 1473 | 1476 |
ff_er_frame_end(s); |
| 1474 | 1477 |
MPV_frame_end(s); |
| 1475 | 1478 |
if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
|
| ... | ... |
@@ -92,7 +92,6 @@ typedef struct RV34DecContext{
|
| 92 | 92 |
const uint8_t *luma_dc_quant_p;///< luma subblock DC quantizer for interframes |
| 93 | 93 |
|
| 94 | 94 |
RV34VLC *cur_vlcs; ///< VLC set used for current frame decoding |
| 95 |
- int bits; ///< slice size in bits |
|
| 96 | 95 |
H264PredContext h; ///< functions for 4x4 and 16x16 intra block prediction |
| 97 | 96 |
SliceInfo si; ///< current slice information |
| 98 | 97 |
|
| ... | ... |
@@ -134,5 +133,7 @@ int ff_rv34_get_start_offset(GetBitContext *gb, int blocks); |
| 134 | 134 |
int ff_rv34_decode_init(AVCodecContext *avctx); |
| 135 | 135 |
int ff_rv34_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt); |
| 136 | 136 |
int ff_rv34_decode_end(AVCodecContext *avctx); |
| 137 |
+int ff_rv34_decode_init_thread_copy(AVCodecContext *avctx); |
|
| 138 |
+int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src); |
|
| 137 | 139 |
|
| 138 | 140 |
#endif /* AVCODEC_RV34_H */ |
| ... | ... |
@@ -566,8 +566,10 @@ AVCodec ff_rv40_decoder = {
|
| 566 | 566 |
.init = rv40_decode_init, |
| 567 | 567 |
.close = ff_rv34_decode_end, |
| 568 | 568 |
.decode = ff_rv34_decode_frame, |
| 569 |
- .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY, |
|
| 569 |
+ .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_FRAME_THREADS, |
|
| 570 | 570 |
.flush = ff_mpeg_flush, |
| 571 | 571 |
.long_name = NULL_IF_CONFIG_SMALL("RealVideo 4.0"),
|
| 572 | 572 |
.pix_fmts = ff_pixfmt_list_420, |
| 573 |
+ .init_thread_copy = ONLY_IF_THREADS_ENABLED(ff_rv34_decode_init_thread_copy), |
|
| 574 |
+ .update_thread_context = ONLY_IF_THREADS_ENABLED(ff_rv34_decode_update_thread_context), |
|
| 573 | 575 |
}; |
| ... | ... |
@@ -38,6 +38,7 @@ |
| 38 | 38 |
#include <sys/ioctl.h> |
| 39 | 39 |
#include <sys/mman.h> |
| 40 | 40 |
#include <sys/time.h> |
| 41 |
+#include <poll.h> |
|
| 41 | 42 |
#if HAVE_SYS_VIDEOIO_H |
| 42 | 43 |
#include <sys/videoio.h> |
| 43 | 44 |
#else |
| ... | ... |
@@ -54,6 +55,7 @@ |
| 54 | 54 |
#include "libavutil/parseutils.h" |
| 55 | 55 |
#include "libavutil/pixdesc.h" |
| 56 | 56 |
#include "libavutil/avstring.h" |
| 57 |
+#include "libavutil/mathematics.h" |
|
| 57 | 58 |
|
| 58 | 59 |
#if CONFIG_LIBV4L2 |
| 59 | 60 |
#include <libv4l2.h> |
| ... | ... |
@@ -79,6 +81,7 @@ struct video_data {
|
| 79 | 79 |
int frame_format; /* V4L2_PIX_FMT_* */ |
| 80 | 80 |
int width, height; |
| 81 | 81 |
int frame_size; |
| 82 |
+ int timeout; |
|
| 82 | 83 |
int interlaced; |
| 83 | 84 |
int top_field_first; |
| 84 | 85 |
|
| ... | ... |
@@ -197,14 +200,11 @@ static int device_init(AVFormatContext *ctx, int *width, int *height, |
| 197 | 197 |
{
|
| 198 | 198 |
struct video_data *s = ctx->priv_data; |
| 199 | 199 |
int fd = s->fd; |
| 200 |
- struct v4l2_format fmt; |
|
| 200 |
+ struct v4l2_format fmt = { .type = V4L2_BUF_TYPE_VIDEO_CAPTURE };
|
|
| 201 | 201 |
struct v4l2_pix_format *pix = &fmt.fmt.pix; |
| 202 | 202 |
|
| 203 | 203 |
int res; |
| 204 | 204 |
|
| 205 |
- memset(&fmt, 0, sizeof(struct v4l2_format)); |
|
| 206 |
- |
|
| 207 |
- fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
|
| 208 | 205 |
pix->width = *width; |
| 209 | 206 |
pix->height = *height; |
| 210 | 207 |
pix->pixelformat = pix_fmt; |
| ... | ... |
@@ -362,13 +362,14 @@ static void list_formats(AVFormatContext *ctx, int fd, int type) |
| 362 | 362 |
|
| 363 | 363 |
static int mmap_init(AVFormatContext *ctx) |
| 364 | 364 |
{
|
| 365 |
- struct video_data *s = ctx->priv_data; |
|
| 366 |
- struct v4l2_requestbuffers req = {0};
|
|
| 367 | 365 |
int i, res; |
| 366 |
+ struct video_data *s = ctx->priv_data; |
|
| 367 |
+ struct v4l2_requestbuffers req = {
|
|
| 368 |
+ .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, |
|
| 369 |
+ .count = desired_video_buffers, |
|
| 370 |
+ .memory = V4L2_MEMORY_MMAP |
|
| 371 |
+ }; |
|
| 368 | 372 |
|
| 369 |
- req.count = desired_video_buffers; |
|
| 370 |
- req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
|
| 371 |
- req.memory = V4L2_MEMORY_MMAP; |
|
| 372 | 373 |
res = v4l2_ioctl(s->fd, VIDIOC_REQBUFS, &req); |
| 373 | 374 |
if (res < 0) {
|
| 374 | 375 |
if (errno == EINVAL) {
|
| ... | ... |
@@ -397,11 +398,11 @@ static int mmap_init(AVFormatContext *ctx) |
| 397 | 397 |
} |
| 398 | 398 |
|
| 399 | 399 |
for (i = 0; i < req.count; i++) {
|
| 400 |
- struct v4l2_buffer buf = {0};
|
|
| 401 |
- |
|
| 402 |
- buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
|
| 403 |
- buf.memory = V4L2_MEMORY_MMAP; |
|
| 404 |
- buf.index = i; |
|
| 400 |
+ struct v4l2_buffer buf = {
|
|
| 401 |
+ .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, |
|
| 402 |
+ .index = i, |
|
| 403 |
+ .memory = V4L2_MEMORY_MMAP |
|
| 404 |
+ }; |
|
| 405 | 405 |
res = v4l2_ioctl(s->fd, VIDIOC_QUERYBUF, &buf); |
| 406 | 406 |
if (res < 0) {
|
| 407 | 407 |
av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_QUERYBUF)\n"); |
| ... | ... |
@@ -431,7 +432,7 @@ static int mmap_init(AVFormatContext *ctx) |
| 431 | 431 |
|
| 432 | 432 |
static void mmap_release_buffer(AVPacket *pkt) |
| 433 | 433 |
{
|
| 434 |
- struct v4l2_buffer buf = {0};
|
|
| 434 |
+ struct v4l2_buffer buf = { 0 };
|
|
| 435 | 435 |
int res, fd; |
| 436 | 436 |
struct buff_data *buf_descriptor = pkt->priv; |
| 437 | 437 |
|
| ... | ... |
@@ -456,12 +457,20 @@ static void mmap_release_buffer(AVPacket *pkt) |
| 456 | 456 |
static int mmap_read_frame(AVFormatContext *ctx, AVPacket *pkt) |
| 457 | 457 |
{
|
| 458 | 458 |
struct video_data *s = ctx->priv_data; |
| 459 |
- struct v4l2_buffer buf = {0};
|
|
| 459 |
+ struct v4l2_buffer buf = {
|
|
| 460 |
+ .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, |
|
| 461 |
+ .memory = V4L2_MEMORY_MMAP |
|
| 462 |
+ }; |
|
| 460 | 463 |
struct buff_data *buf_descriptor; |
| 464 |
+ struct pollfd p = { .fd = s->fd, .events = POLLIN };
|
|
| 461 | 465 |
int res; |
| 462 | 466 |
|
| 463 |
- buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
|
| 464 |
- buf.memory = V4L2_MEMORY_MMAP; |
|
| 467 |
+ res = poll(&p, 1, s->timeout); |
|
| 468 |
+ if (res < 0) |
|
| 469 |
+ return AVERROR(errno); |
|
| 470 |
+ |
|
| 471 |
+ if (!(p.revents & (POLLIN | POLLERR | POLLHUP))) |
|
| 472 |
+ return AVERROR(EAGAIN); |
|
| 465 | 473 |
|
| 466 | 474 |
/* FIXME: Some special treatment might be needed in case of loss of signal... */ |
| 467 | 475 |
while ((res = v4l2_ioctl(s->fd, VIDIOC_DQBUF, &buf)) < 0 && (errno == EINTR)); |
| ... | ... |
@@ -513,11 +522,11 @@ static int mmap_start(AVFormatContext *ctx) |
| 513 | 513 |
int i, res; |
| 514 | 514 |
|
| 515 | 515 |
for (i = 0; i < s->buffers; i++) {
|
| 516 |
- struct v4l2_buffer buf = {0};
|
|
| 517 |
- |
|
| 518 |
- buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
|
| 519 |
- buf.memory = V4L2_MEMORY_MMAP; |
|
| 520 |
- buf.index = i; |
|
| 516 |
+ struct v4l2_buffer buf = {
|
|
| 517 |
+ .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, |
|
| 518 |
+ .index = i, |
|
| 519 |
+ .memory = V4L2_MEMORY_MMAP |
|
| 520 |
+ }; |
|
| 521 | 521 |
|
| 522 | 522 |
res = v4l2_ioctl(s->fd, VIDIOC_QBUF, &buf); |
| 523 | 523 |
if (res < 0) {
|
| ... | ... |
@@ -560,12 +569,12 @@ static void mmap_close(struct video_data *s) |
| 560 | 560 |
static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap) |
| 561 | 561 |
{
|
| 562 | 562 |
struct video_data *s = s1->priv_data; |
| 563 |
- struct v4l2_input input = {0};
|
|
| 564 |
- struct v4l2_standard standard = {0};
|
|
| 565 |
- struct v4l2_streamparm streamparm = {0};
|
|
| 563 |
+ struct v4l2_input input = { 0 };
|
|
| 564 |
+ struct v4l2_standard standard = { 0 };
|
|
| 565 |
+ struct v4l2_streamparm streamparm = { 0 };
|
|
| 566 | 566 |
struct v4l2_fract *tpf = &streamparm.parm.capture.timeperframe; |
| 567 |
+ AVRational framerate_q = { 0 };
|
|
| 567 | 568 |
int i, ret; |
| 568 |
- AVRational framerate_q={0};
|
|
| 569 | 569 |
|
| 570 | 570 |
streamparm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
| 571 | 571 |
|
| ... | ... |
@@ -596,7 +605,7 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap) |
| 596 | 596 |
av_log(s1, AV_LOG_DEBUG, "The V4L2 driver set standard: %s\n", |
| 597 | 597 |
s->standard); |
| 598 | 598 |
/* set tv standard */ |
| 599 |
- for (i = 0;; i++) {
|
|
| 599 |
+ for(i=0;;i++) {
|
|
| 600 | 600 |
standard.index = i; |
| 601 | 601 |
ret = v4l2_ioctl(s->fd, VIDIOC_ENUMSTD, &standard); |
| 602 | 602 |
if (ret < 0 || !av_strcasecmp(standard.name, s->standard)) |
| ... | ... |
@@ -649,6 +658,10 @@ static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap) |
| 649 | 649 |
s1->streams[0]->codec->time_base.den = tpf->denominator; |
| 650 | 650 |
s1->streams[0]->codec->time_base.num = tpf->numerator; |
| 651 | 651 |
|
| 652 |
+ s->timeout = 100 + |
|
| 653 |
+ av_rescale_q(1, s1->streams[0]->codec->time_base, |
|
| 654 |
+ (AVRational){1, 1000});
|
|
| 655 |
+ |
|
| 652 | 656 |
return 0; |
| 653 | 657 |
} |
| 654 | 658 |
|
| ... | ... |
@@ -722,11 +735,15 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap) |
| 722 | 722 |
} |
| 723 | 723 |
|
| 724 | 724 |
if (s->pixel_format) {
|
| 725 |
+ AVCodec *codec = avcodec_find_decoder_by_name(s->pixel_format); |
|
| 726 |
+ |
|
| 727 |
+ if (codec) |
|
| 728 |
+ s1->video_codec_id = codec->id; |
|
| 725 | 729 |
|
| 726 | 730 |
pix_fmt = av_get_pix_fmt(s->pixel_format); |
| 727 | 731 |
|
| 728 |
- if (pix_fmt == PIX_FMT_NONE) {
|
|
| 729 |
- av_log(s1, AV_LOG_ERROR, "No such pixel format: %s.\n", |
|
| 732 |
+ if (pix_fmt == PIX_FMT_NONE && !codec) {
|
|
| 733 |
+ av_log(s1, AV_LOG_ERROR, "No such input format: %s.\n", |
|
| 730 | 734 |
s->pixel_format); |
| 731 | 735 |
|
| 732 | 736 |
res = AVERROR(EINVAL); |
| ... | ... |
@@ -832,7 +849,8 @@ static const AVOption options[] = {
|
| 832 | 832 |
{ "standard", "TV standard, used only by analog frame grabber", OFFSET(standard), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC },
|
| 833 | 833 |
{ "channel", "TV channel, used only by frame grabber", OFFSET(channel), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, DEC },
|
| 834 | 834 |
{ "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
|
| 835 |
- { "pixel_format", "", OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
|
|
| 835 |
+ { "pixel_format", "Preferred pixel format", OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
|
|
| 836 |
+ { "input_format", "Preferred pixel format (for raw video) or codec name", OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
|
|
| 836 | 837 |
{ "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
|
| 837 | 838 |
{ "list_formats", "List available formats and exit", OFFSET(list_format), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, DEC, "list_formats" },
|
| 838 | 839 |
{ "all", "Show all available formats", OFFSET(list_format), AV_OPT_TYPE_CONST, {.dbl = V4L_ALLFORMATS }, 0, INT_MAX, DEC, "list_formats" },
|
| ... | ... |
@@ -39,6 +39,12 @@ typedef struct {
|
| 39 | 39 |
char sws_param[256]; |
| 40 | 40 |
} BufferSourceContext; |
| 41 | 41 |
|
| 42 |
+#define CHECK_PARAM_CHANGE(s, c, width, height, format)\ |
|
| 43 |
+ if (c->w != width || c->h != height || c->pix_fmt != format) {\
|
|
| 44 |
+ av_log(s, AV_LOG_ERROR, "Changing frame properties on the fly is not supported.\n");\ |
|
| 45 |
+ return AVERROR(EINVAL);\ |
|
| 46 |
+ } |
|
| 47 |
+ |
|
| 42 | 48 |
int av_vsrc_buffer_add_video_buffer_ref(AVFilterContext *buffer_filter, |
| 43 | 49 |
AVFilterBufferRef *picref, int flags) |
| 44 | 50 |
{
|
| ... | ... |
@@ -125,6 +131,8 @@ int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf) |
| 125 | 125 |
return AVERROR(EINVAL); |
| 126 | 126 |
} |
| 127 | 127 |
|
| 128 |
+// CHECK_PARAM_CHANGE(s, c, buf->video->w, buf->video->h, buf->format); |
|
| 129 |
+ |
|
| 128 | 130 |
c->picref = buf; |
| 129 | 131 |
|
| 130 | 132 |
return 0; |
| ... | ... |
@@ -144,7 +144,7 @@ static int load_ipmovie_packet(IPMVEContext *s, AVIOContext *pb, |
| 144 | 144 |
(s->audio_chunk_size / s->audio_channels / (s->audio_bits / 8)); |
| 145 | 145 |
else |
| 146 | 146 |
s->audio_frame_count += |
| 147 |
- (s->audio_chunk_size - 6) / s->audio_channels; |
|
| 147 |
+ (s->audio_chunk_size - 6 - s->audio_channels) / s->audio_channels; |
|
| 148 | 148 |
|
| 149 | 149 |
av_dlog(NULL, "sending audio frame with pts %"PRId64" (%d audio frames)\n", |
| 150 | 150 |
pkt->pts, s->audio_frame_count); |
| ... | ... |
@@ -2570,7 +2570,8 @@ static int mov_write_header(AVFormatContext *s) |
| 2570 | 2570 |
#endif |
| 2571 | 2571 |
if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) |
| 2572 | 2572 |
mov->time = ff_iso8601_to_unix_time(t->value); |
| 2573 |
- mov->time += 0x7C25B080; //1970 based -> 1904 based |
|
| 2573 |
+ if (mov->time) |
|
| 2574 |
+ mov->time += 0x7C25B080; // 1970 based -> 1904 based |
|
| 2574 | 2575 |
|
| 2575 | 2576 |
if (mov->chapter_track) |
| 2576 | 2577 |
mov_create_chapter_track(s, mov->chapter_track); |
| ... | ... |
@@ -207,7 +207,7 @@ static int vmd_read_header(AVFormatContext *s, |
| 207 | 207 |
vmd->frame_table[total_frames].pts = current_audio_pts; |
| 208 | 208 |
total_frames++; |
| 209 | 209 |
if(!current_audio_pts) |
| 210 |
- current_audio_pts += sound_buffers; |
|
| 210 |
+ current_audio_pts += sound_buffers - 1; |
|
| 211 | 211 |
else |
| 212 | 212 |
current_audio_pts++; |
| 213 | 213 |
break; |
| ... | ... |
@@ -135,7 +135,7 @@ cglobal %2ToY, 5, 5, %1, dst, unused0, unused1, src, w |
| 135 | 135 |
%macro YUYV_TO_UV_FN 2-3 |
| 136 | 136 |
cglobal %2ToUV, 4, 5, %1, dstU, dstV, unused, src, w |
| 137 | 137 |
%ifdef ARCH_X86_64 |
| 138 |
- movsxd wq, r5m |
|
| 138 |
+ movsxd wq, dword r5m |
|
| 139 | 139 |
%else ; x86-32 |
| 140 | 140 |
mov wq, r5m |
| 141 | 141 |
%endif |
| ... | ... |
@@ -190,7 +190,7 @@ cglobal %2ToUV, 4, 5, %1, dstU, dstV, unused, src, w |
| 190 | 190 |
%macro NVXX_TO_UV_FN 2 |
| 191 | 191 |
cglobal %2ToUV, 4, 5, %1, dstU, dstV, unused, src, w |
| 192 | 192 |
%ifdef ARCH_X86_64 |
| 193 |
- movsxd wq, r5m |
|
| 193 |
+ movsxd wq, dword r5m |
|
| 194 | 194 |
%else ; x86-32 |
| 195 | 195 |
mov wq, r5m |
| 196 | 196 |
%endif |
| ... | ... |
@@ -1584,12 +1584,24 @@ static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst, |
| 1584 | 1584 |
void *mmx2FilterCode= c->lumMmx2FilterCode; |
| 1585 | 1585 |
int i; |
| 1586 | 1586 |
#if defined(PIC) |
| 1587 |
- DECLARE_ALIGNED(8, uint64_t, ebxsave); |
|
| 1587 |
+ uint64_t ebxsave; |
|
| 1588 |
+#endif |
|
| 1589 |
+#if ARCH_X86_64 |
|
| 1590 |
+ uint64_t retsave; |
|
| 1588 | 1591 |
#endif |
| 1589 | 1592 |
|
| 1590 | 1593 |
__asm__ volatile( |
| 1591 | 1594 |
#if defined(PIC) |
| 1592 | 1595 |
"mov %%"REG_b", %5 \n\t" |
| 1596 |
+#if ARCH_X86_64 |
|
| 1597 |
+ "mov -8(%%rsp), %%"REG_a" \n\t" |
|
| 1598 |
+ "mov %%"REG_a", %6 \n\t" |
|
| 1599 |
+#endif |
|
| 1600 |
+#else |
|
| 1601 |
+#if ARCH_X86_64 |
|
| 1602 |
+ "mov -8(%%rsp), %%"REG_a" \n\t" |
|
| 1603 |
+ "mov %%"REG_a", %5 \n\t" |
|
| 1604 |
+#endif |
|
| 1593 | 1605 |
#endif |
| 1594 | 1606 |
"pxor %%mm7, %%mm7 \n\t" |
| 1595 | 1607 |
"mov %0, %%"REG_c" \n\t" |
| ... | ... |
@@ -1631,12 +1643,24 @@ static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst, |
| 1631 | 1631 |
|
| 1632 | 1632 |
#if defined(PIC) |
| 1633 | 1633 |
"mov %5, %%"REG_b" \n\t" |
| 1634 |
+#if ARCH_X86_64 |
|
| 1635 |
+ "mov %6, %%"REG_a" \n\t" |
|
| 1636 |
+ "mov %%"REG_a", -8(%%rsp) \n\t" |
|
| 1637 |
+#endif |
|
| 1638 |
+#else |
|
| 1639 |
+#if ARCH_X86_64 |
|
| 1640 |
+ "mov %5, %%"REG_a" \n\t" |
|
| 1641 |
+ "mov %%"REG_a", -8(%%rsp) \n\t" |
|
| 1642 |
+#endif |
|
| 1634 | 1643 |
#endif |
| 1635 | 1644 |
:: "m" (src), "m" (dst), "m" (filter), "m" (filterPos), |
| 1636 | 1645 |
"m" (mmx2FilterCode) |
| 1637 | 1646 |
#if defined(PIC) |
| 1638 | 1647 |
,"m" (ebxsave) |
| 1639 | 1648 |
#endif |
| 1649 |
+#if ARCH_X86_64 |
|
| 1650 |
+ ,"m"(retsave) |
|
| 1651 |
+#endif |
|
| 1640 | 1652 |
: "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D |
| 1641 | 1653 |
#if !defined(PIC) |
| 1642 | 1654 |
,"%"REG_b |
| ... | ... |
@@ -1658,10 +1682,22 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2, |
| 1658 | 1658 |
#if defined(PIC) |
| 1659 | 1659 |
DECLARE_ALIGNED(8, uint64_t, ebxsave); |
| 1660 | 1660 |
#endif |
| 1661 |
+#if ARCH_X86_64 |
|
| 1662 |
+ DECLARE_ALIGNED(8, uint64_t, retsave); |
|
| 1663 |
+#endif |
|
| 1661 | 1664 |
|
| 1662 | 1665 |
__asm__ volatile( |
| 1663 | 1666 |
#if defined(PIC) |
| 1664 | 1667 |
"mov %%"REG_b", %7 \n\t" |
| 1668 |
+#if ARCH_X86_64 |
|
| 1669 |
+ "mov -8(%%rsp), %%"REG_a" \n\t" |
|
| 1670 |
+ "mov %%"REG_a", %8 \n\t" |
|
| 1671 |
+#endif |
|
| 1672 |
+#else |
|
| 1673 |
+#if ARCH_X86_64 |
|
| 1674 |
+ "mov -8(%%rsp), %%"REG_a" \n\t" |
|
| 1675 |
+ "mov %%"REG_a", %7 \n\t" |
|
| 1676 |
+#endif |
|
| 1665 | 1677 |
#endif |
| 1666 | 1678 |
"pxor %%mm7, %%mm7 \n\t" |
| 1667 | 1679 |
"mov %0, %%"REG_c" \n\t" |
| ... | ... |
@@ -1691,12 +1727,24 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2, |
| 1691 | 1691 |
|
| 1692 | 1692 |
#if defined(PIC) |
| 1693 | 1693 |
"mov %7, %%"REG_b" \n\t" |
| 1694 |
+#if ARCH_X86_64 |
|
| 1695 |
+ "mov %8, %%"REG_a" \n\t" |
|
| 1696 |
+ "mov %%"REG_a", -8(%%rsp) \n\t" |
|
| 1697 |
+#endif |
|
| 1698 |
+#else |
|
| 1699 |
+#if ARCH_X86_64 |
|
| 1700 |
+ "mov %7, %%"REG_a" \n\t" |
|
| 1701 |
+ "mov %%"REG_a", -8(%%rsp) \n\t" |
|
| 1702 |
+#endif |
|
| 1694 | 1703 |
#endif |
| 1695 | 1704 |
:: "m" (src1), "m" (dst1), "m" (filter), "m" (filterPos), |
| 1696 | 1705 |
"m" (mmx2FilterCode), "m" (src2), "m"(dst2) |
| 1697 | 1706 |
#if defined(PIC) |
| 1698 | 1707 |
,"m" (ebxsave) |
| 1699 | 1708 |
#endif |
| 1709 |
+#if ARCH_X86_64 |
|
| 1710 |
+ ,"m"(retsave) |
|
| 1711 |
+#endif |
|
| 1700 | 1712 |
: "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D |
| 1701 | 1713 |
#if !defined(PIC) |
| 1702 | 1714 |
,"%"REG_b |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-4fe333ff79e86cca6ba8c109cc08263e *./tests/data/acodec/alac.m4a |
|
| 1 |
+cf9a4b40ab945367cbb0e6cbb4cf37a1 *./tests/data/acodec/alac.m4a |
|
| 2 | 2 |
389166 ./tests/data/acodec/alac.m4a |
| 3 | 3 |
64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/alac.acodec.out.wav |
| 4 | 4 |
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-d07e475322765c20b1fcdb822ad5dc04 *./tests/data/acodec/pcm_s16be.mov |
|
| 1 |
+4529713e8b744edb3e62c4e688a3f987 *./tests/data/acodec/pcm_s16be.mov |
|
| 2 | 2 |
1059065 ./tests/data/acodec/pcm_s16be.mov |
| 3 | 3 |
64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/pcm_s16be.acodec.out.wav |
| 4 | 4 |
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-f66d9543a4e04346818e802c4f2d7a30 *./tests/data/acodec/pcm_s24be.mov |
|
| 1 |
+8a7b79317738f91a137c7f6519c3df72 *./tests/data/acodec/pcm_s24be.mov |
|
| 2 | 2 |
1588265 ./tests/data/acodec/pcm_s24be.mov |
| 3 | 3 |
64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/pcm_s24be.acodec.out.wav |
| 4 | 4 |
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-09c919947211de14b3ad0e7603e5b44e *./tests/data/acodec/pcm_s32be.mov |
|
| 1 |
+c9f29c97890f69796faa227c3c08c3d8 *./tests/data/acodec/pcm_s32be.mov |
|
| 2 | 2 |
2117465 ./tests/data/acodec/pcm_s32be.mov |
| 3 | 3 |
64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/pcm_s32be.acodec.out.wav |
| 4 | 4 |
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-52d8c65c4987227979785d5ac2030175 *./tests/data/acodec/pcm_s8.mov |
|
| 1 |
+bfd442109b661daf8ee7a468d9d6b944 *./tests/data/acodec/pcm_s8.mov |
|
| 2 | 2 |
529865 ./tests/data/acodec/pcm_s8.mov |
| 3 | 3 |
651d4eb8d98dfcdda96ae6c43d8f156b *./tests/data/pcm_s8.acodec.out.wav |
| 4 | 4 |
stddev: 147.89 PSNR: 52.93 MAXDIFF: 255 bytes: 1058400/ 1058400 |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-d2621659037803a30b77e3d4f87eb733 *./tests/data/vsynth1/dnxhd-1080i.mov |
|
| 1 |
+153afc6bd83611db4ba0d6d509fc3d74 *./tests/data/vsynth1/dnxhd-1080i.mov |
|
| 2 | 2 |
3031895 ./tests/data/vsynth1/dnxhd-1080i.mov |
| 3 | 3 |
0c651e840f860592f0d5b66030d9fa32 *./tests/data/dnxhd_1080i.vsynth1.out.yuv |
| 4 | 4 |
stddev: 6.29 PSNR: 32.15 MAXDIFF: 64 bytes: 760320/ 7603200 |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-f32960be0f05be8b2ed03447e1eaea6f *./tests/data/vsynth1/odivx.mp4 |
|
| 1 |
+6ea715a2de70af8d37128ce643e4cca0 *./tests/data/vsynth1/odivx.mp4 |
|
| 2 | 2 |
539996 ./tests/data/vsynth1/odivx.mp4 |
| 3 | 3 |
8828a375448dc5c2215163ba70656f89 *./tests/data/mpeg4.vsynth1.out.yuv |
| 4 | 4 |
stddev: 7.97 PSNR: 30.10 MAXDIFF: 105 bytes: 7603200/ 7603200 |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-062e1f5ec6ebdbc43ee69e0393221866 *./tests/data/vsynth1/prores.mov |
|
| 1 |
+e8487134a5e4b8351de7ad386fb25e27 *./tests/data/vsynth1/prores.mov |
|
| 2 | 2 |
5022795 ./tests/data/vsynth1/prores.mov |
| 3 | 3 |
a2e2d1d45341a94ff994d1d92629f778 *./tests/data/prores.vsynth1.out.yuv |
| 4 | 4 |
stddev: 2.47 PSNR: 40.27 MAXDIFF: 31 bytes: 7603200/ 7603200 |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-b67340783a817fe398fd138175c7fa07 *./tests/data/vsynth1/qtrle.mov |
|
| 1 |
+54a37ac94abdd95b9e5726a2211e8e1c *./tests/data/vsynth1/qtrle.mov |
|
| 2 | 2 |
15263072 ./tests/data/vsynth1/qtrle.mov |
| 3 | 3 |
93695a27c24a61105076ca7b1f010bbd *./tests/data/qtrle.vsynth1.out.yuv |
| 4 | 4 |
stddev: 3.42 PSNR: 37.44 MAXDIFF: 48 bytes: 7603200/ 7603200 |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-f0c3cd26e80674a62683685d0508622a *./tests/data/vsynth1/qtrlegray.mov |
|
| 1 |
+7b04fbf0fa29600517d048882583128b *./tests/data/vsynth1/qtrlegray.mov |
|
| 2 | 2 |
5113268 ./tests/data/vsynth1/qtrlegray.mov |
| 3 | 3 |
29def4aed035ed65d3a89f7d382fccbe *./tests/data/qtrlegray.vsynth1.out.yuv |
| 4 | 4 |
stddev: 25.95 PSNR: 19.85 MAXDIFF: 122 bytes: 7603200/ 7603200 |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-ebaf85e8743ad1f6c2228d473fe16d83 *./tests/data/vsynth1/svq1.mov |
|
| 1 |
+0658c40cfef3964c60bb9b05233727de *./tests/data/vsynth1/svq1.mov |
|
| 2 | 2 |
1334207 ./tests/data/vsynth1/svq1.mov |
| 3 | 3 |
9cc35c54b2c77d36bd7e308b393c1f81 *./tests/data/svq1.vsynth1.out.yuv |
| 4 | 4 |
stddev: 9.58 PSNR: 28.50 MAXDIFF: 210 bytes: 7603200/ 7603200 |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-af3b282a2194a7e2748df7684330728a *./tests/data/vsynth2/dnxhd-1080i.mov |
|
| 1 |
+677588203650770792b63a66231bd127 *./tests/data/vsynth2/dnxhd-1080i.mov |
|
| 2 | 2 |
3031895 ./tests/data/vsynth2/dnxhd-1080i.mov |
| 3 | 3 |
3c559af629ae0a8fb1a9a0e4b4da7733 *./tests/data/dnxhd_1080i.vsynth2.out.yuv |
| 4 | 4 |
stddev: 1.31 PSNR: 45.77 MAXDIFF: 23 bytes: 760320/ 7603200 |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-4d092ca067362a61b9c96f5f12a1ab5a *./tests/data/vsynth2/odivx.mp4 |
|
| 1 |
+051ff85797971b9047723044eaec07be *./tests/data/vsynth2/odivx.mp4 |
|
| 2 | 2 |
119649 ./tests/data/vsynth2/odivx.mp4 |
| 3 | 3 |
90a3577850239083a9042bef33c50e85 *./tests/data/mpeg4.vsynth2.out.yuv |
| 4 | 4 |
stddev: 5.34 PSNR: 33.57 MAXDIFF: 83 bytes: 7603200/ 7603200 |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-85f16a09120b668d02cb9cce86dfa9b1 *./tests/data/vsynth2/prores.mov |
|
| 1 |
+81988143e6169dbf735bd180bf5a8703 *./tests/data/vsynth2/prores.mov |
|
| 2 | 2 |
2844034 ./tests/data/vsynth2/prores.mov |
| 3 | 3 |
b5844025c0f4c7c37db702c3213db232 *./tests/data/prores.vsynth2.out.yuv |
| 4 | 4 |
stddev: 1.31 PSNR: 45.77 MAXDIFF: 11 bytes: 7603200/ 7603200 |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-f18ed8321e19a7cadedc3ba32d71e0ea *./tests/data/vsynth2/qtrle.mov |
|
| 1 |
+04c58848958a0684eba8a816e00dba28 *./tests/data/vsynth2/qtrle.mov |
|
| 2 | 2 |
14798259 ./tests/data/vsynth2/qtrle.mov |
| 3 | 3 |
98d0e2854731472c5bf13d8638502d0a *./tests/data/qtrle.vsynth2.out.yuv |
| 4 | 4 |
stddev: 1.26 PSNR: 46.10 MAXDIFF: 13 bytes: 7603200/ 7603200 |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-799451fc6215c51fc892a2284721b8e7 *./tests/data/vsynth2/qtrlegray.mov |
|
| 1 |
+b9769bd1ff7e3b0fb26dfc7555e789b4 *./tests/data/vsynth2/qtrlegray.mov |
|
| 2 | 2 |
5111257 ./tests/data/vsynth2/qtrlegray.mov |
| 3 | 3 |
f63b5ebdfdba750e547c25131b0a3fd1 *./tests/data/qtrlegray.vsynth2.out.yuv |
| 4 | 4 |
stddev: 19.42 PSNR: 22.36 MAXDIFF: 72 bytes: 7603200/ 7603200 |
| ... | ... |
@@ -1,4 +1,4 @@ |
| 1 |
-8d5275bf59aac368d5da11d9c34b8cf2 *./tests/data/vsynth2/svq1.mov |
|
| 1 |
+320a7fbbaecc0989df054bf9678bfdf6 *./tests/data/vsynth2/svq1.mov |
|
| 2 | 2 |
766691 ./tests/data/vsynth2/svq1.mov |
| 3 | 3 |
aa03471dac3f49455a33a2b19fda1098 *./tests/data/svq1.vsynth2.out.yuv |
| 4 | 4 |
stddev: 3.23 PSNR: 37.93 MAXDIFF: 61 bytes: 7603200/ 7603200 |