OLD | NEW |
1 /* | 1 /* |
2 * VP8 compatible video decoder | 2 * VP8 compatible video decoder |
3 * | 3 * |
4 * Copyright (C) 2010 David Conrad | 4 * Copyright (C) 2010 David Conrad |
5 * Copyright (C) 2010 Ronald S. Bultje | 5 * Copyright (C) 2010 Ronald S. Bultje |
6 * Copyright (C) 2010 Jason Garrett-Glaser | 6 * Copyright (C) 2010 Jason Garrett-Glaser |
7 * | 7 * |
8 * This file is part of FFmpeg. | 8 * This file is part of FFmpeg. |
9 * | 9 * |
10 * FFmpeg is free software; you can redistribute it and/or | 10 * FFmpeg is free software; you can redistribute it and/or |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 avcodec_set_dimensions(s->avctx, width, height); | 118 avcodec_set_dimensions(s->avctx, width, height); |
119 } | 119 } |
120 | 120 |
121 s->mb_width = (s->avctx->coded_width +15) / 16; | 121 s->mb_width = (s->avctx->coded_width +15) / 16; |
122 s->mb_height = (s->avctx->coded_height+15) / 16; | 122 s->mb_height = (s->avctx->coded_height+15) / 16; |
123 | 123 |
124 s->macroblocks_base = av_mallocz((s->mb_width+s->mb_height*2+1)*sizeo
f(*s->macroblocks)); | 124 s->macroblocks_base = av_mallocz((s->mb_width+s->mb_height*2+1)*sizeo
f(*s->macroblocks)); |
125 s->filter_strength = av_mallocz(s->mb_width*sizeof(*s->filter_streng
th)); | 125 s->filter_strength = av_mallocz(s->mb_width*sizeof(*s->filter_streng
th)); |
126 s->intra4x4_pred_mode_top = av_mallocz(s->mb_width*4); | 126 s->intra4x4_pred_mode_top = av_mallocz(s->mb_width*4); |
127 s->top_nnz = av_mallocz(s->mb_width*sizeof(*s->top_nnz)); | 127 s->top_nnz = av_mallocz((s->mb_width+1)*sizeof(*s->top_nnz))
; |
128 s->top_border = av_mallocz((s->mb_width+1)*sizeof(*s->top_borde
r)); | 128 s->top_border = av_mallocz((s->mb_width+1)*sizeof(*s->top_borde
r)); |
129 | 129 |
130 if (!s->macroblocks_base || !s->filter_strength || !s->intra4x4_pred_mode_to
p || | 130 if (!s->macroblocks_base || !s->filter_strength || !s->intra4x4_pred_mode_to
p || |
131 !s->top_nnz || !s->top_border) | 131 !s->top_nnz || !s->top_border) |
132 return AVERROR(ENOMEM); | 132 return AVERROR(ENOMEM); |
133 | 133 |
134 s->macroblocks = s->macroblocks_base + 1; | 134 s->macroblocks = s->macroblocks_base + 1; |
135 | 135 |
136 return 0; | 136 return 0; |
137 } | 137 } |
(...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1845 .priv_data_size = sizeof(VP8Context), | 1845 .priv_data_size = sizeof(VP8Context), |
1846 .init = vp8_decode_init, | 1846 .init = vp8_decode_init, |
1847 .close = vp8_decode_free, | 1847 .close = vp8_decode_free, |
1848 .decode = vp8_decode_frame, | 1848 .decode = vp8_decode_frame, |
1849 .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS, | 1849 .capabilities = CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS, |
1850 .flush = vp8_decode_flush, | 1850 .flush = vp8_decode_flush, |
1851 .long_name = NULL_IF_CONFIG_SMALL("On2 VP8"), | 1851 .long_name = NULL_IF_CONFIG_SMALL("On2 VP8"), |
1852 .init_thread_copy = ONLY_IF_THREADS_ENABLED(vp8_decode_init_thread_copy
), | 1852 .init_thread_copy = ONLY_IF_THREADS_ENABLED(vp8_decode_init_thread_copy
), |
1853 .update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_co
ntext), | 1853 .update_thread_context = ONLY_IF_THREADS_ENABLED(vp8_decode_update_thread_co
ntext), |
1854 }; | 1854 }; |
OLD | NEW |