* [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7
@ 2022-09-10 0:19 Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 02/18] avcodec/vp8: Disable lf_delta " Andreas Rheinhardt
` (16 more replies)
0 siblings, 17 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 0:19 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Segmentation is a VP8-feature.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vp8.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 0e16e75faa..c00c5c975e 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -637,7 +637,6 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
for (i = 0; i < 2; i++)
memcpy(s->prob->mvc[i], vp7_mv_default_prob[i],
sizeof(vp7_mv_default_prob[i]));
- memset(&s->segmentation, 0, sizeof(s->segmentation));
memset(&s->lf_delta, 0, sizeof(s->lf_delta));
memcpy(s->prob[0].scan, ff_zigzag_scan, sizeof(s->prob[0].scan));
}
@@ -2165,7 +2164,7 @@ void filter_level_for_mb(VP8Context *s, VP8Macroblock *mb,
{
int interior_limit, filter_level;
- if (s->segmentation.enabled) {
+ if (!is_vp7 && s->segmentation.enabled) {
filter_level = s->segmentation.filter_level[mb->segment];
if (!s->segmentation.absolute_vals)
filter_level += s->filter.level;
@@ -2435,7 +2434,7 @@ static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void
else {
// Make sure the previous frame has read its segmentation map,
// if we re-use the same map.
- if (prev_frame && s->segmentation.enabled &&
+ if (!is_vp7 && prev_frame && s->segmentation.enabled &&
!s->segmentation.update_map)
ff_thread_await_progress(&prev_frame->tf, mb_y, 0);
mb = s->macroblocks + (s->mb_height - mb_y - 1) * 2;
@@ -2791,15 +2790,16 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame,
memset(s->ref_count, 0, sizeof(s->ref_count));
if (s->mb_layout == 1) {
- // Make sure the previous frame has read its segmentation map,
- // if we re-use the same map.
- if (prev_frame && s->segmentation.enabled &&
- !s->segmentation.update_map)
- ff_thread_await_progress(&prev_frame->tf, 1, 0);
- if (is_vp7)
+ if (is_vp7) {
ret = vp7_decode_mv_mb_modes(avctx, curframe, prev_frame);
- else
+ } else {
+ // Make sure the previous frame has read its segmentation map,
+ // if we re-use the same map.
+ if (prev_frame && s->segmentation.enabled &&
+ !s->segmentation.update_map)
+ ff_thread_await_progress(&prev_frame->tf, 1, 0);
ret = vp8_decode_mv_mb_modes(avctx, curframe, prev_frame);
+ }
if (ret < 0)
goto err;
}
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 02/18] avcodec/vp8: Disable lf_delta for VP7
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
2022-09-11 4:29 ` Peter Ross
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 03/18] avcodec/vp8: Remove unused macros Andreas Rheinhardt
` (15 subsequent siblings)
16 siblings, 1 reply; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It is a VP8-only feature.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vp8.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index c00c5c975e..04a2113cc8 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -637,7 +637,6 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
for (i = 0; i < 2; i++)
memcpy(s->prob->mvc[i], vp7_mv_default_prob[i],
sizeof(vp7_mv_default_prob[i]));
- memset(&s->lf_delta, 0, sizeof(s->lf_delta));
memcpy(s->prob[0].scan, ff_zigzag_scan, sizeof(s->prob[0].scan));
}
@@ -2171,7 +2170,7 @@ void filter_level_for_mb(VP8Context *s, VP8Macroblock *mb,
} else
filter_level = s->filter.level;
- if (s->lf_delta.enabled) {
+ if (!is_vp7 && s->lf_delta.enabled) {
filter_level += s->lf_delta.ref[mb->ref_frame];
filter_level += s->lf_delta.mode[mb->mode];
}
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 03/18] avcodec/vp8: Remove unused macros
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 02/18] avcodec/vp8: Disable lf_delta " Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 04/18] avcodec/vp8: Inline mb_layout for VP7 Andreas Rheinhardt
` (14 subsequent siblings)
16 siblings, 0 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vp8.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 04a2113cc8..50e879ef0b 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -44,14 +44,6 @@
# include "arm/vp8.h"
#endif
-#if CONFIG_VP7_DECODER && CONFIG_VP8_DECODER
-#define VPX(vp7, f) (vp7 ? vp7_ ## f : vp8_ ## f)
-#elif CONFIG_VP7_DECODER
-#define VPX(vp7, f) vp7_ ## f
-#else // CONFIG_VP8_DECODER
-#define VPX(vp7, f) vp8_ ## f
-#endif
-
// fixme: add 1 bit to all the calls to this?
static int vp8_rac_get_sint(VPXRangeCoder *c, int bits)
{
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 04/18] avcodec/vp8: Inline mb_layout for VP7
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 02/18] avcodec/vp8: Disable lf_delta " Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 03/18] avcodec/vp8: Remove unused macros Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 05/18] avcodec/vp8: Inline inner_filter " Andreas Rheinhardt
` (13 subsequent siblings)
16 siblings, 0 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It is always one for VP7.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vp8.c | 42 ++++++++++++++++++++----------------------
1 file changed, 20 insertions(+), 22 deletions(-)
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 50e879ef0b..635e45f87e 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -244,11 +244,11 @@ int update_dimensions(VP8Context *s, int width, int height, int is_vp7)
s->mb_layout = is_vp7 || avctx->active_thread_type == FF_THREAD_SLICE &&
avctx->thread_count > 1;
- if (!s->mb_layout) { // Frame threading and one thread
+ if (!s->mb_layout) { // Frame threading and one thread when VP8
s->macroblocks_base = av_mallocz((s->mb_width + s->mb_height * 2 + 1) *
sizeof(*s->macroblocks));
s->intra4x4_pred_mode_top = av_mallocz(s->mb_width * 4);
- } else // Sliced threading
+ } else // Sliced threading or VP7
s->macroblocks_base = av_mallocz((s->mb_width + 2) * (s->mb_height + 2) *
sizeof(*s->macroblocks));
s->top_nnz = av_mallocz(s->mb_width * sizeof(*s->top_nnz));
@@ -256,7 +256,7 @@ int update_dimensions(VP8Context *s, int width, int height, int is_vp7)
s->thread_data = av_mallocz(MAX_THREADS * sizeof(VP8ThreadData));
if (!s->macroblocks_base || !s->top_nnz || !s->top_border ||
- !s->thread_data || (!s->intra4x4_pred_mode_top && !s->mb_layout)) {
+ !s->thread_data || (!s->intra4x4_pred_mode_top && (!is_vp7 && !s->mb_layout))) {
free_buffers(s);
return AVERROR(ENOMEM);
}
@@ -1044,7 +1044,7 @@ static const VP8mv *get_bmv_ptr(const VP8Macroblock *mb, int subblock)
static av_always_inline
void vp7_decode_mvs(VP8Context *s, VP8Macroblock *mb,
- int mb_x, int mb_y, int layout)
+ int mb_x, int mb_y)
{
VP8Macroblock *mb_edge[12];
enum { CNT_ZERO, CNT_NEAREST, CNT_NEAR };
@@ -1065,11 +1065,8 @@ void vp7_decode_mvs(VP8Context *s, VP8Macroblock *mb,
if (vp7_calculate_mb_offset(mb_x, mb_y, s->mb_width, pred->xoffset,
pred->yoffset, !s->profile, &edge_x, &edge_y)) {
- VP8Macroblock *edge = mb_edge[i] = (s->mb_layout == 1)
- ? s->macroblocks_base + 1 + edge_x +
- (s->mb_width + 1) * (edge_y + 1)
- : s->macroblocks + edge_x +
- (s->mb_height - edge_y - 1) * 2;
+ VP8Macroblock *edge = mb_edge[i] = s->macroblocks_base + 1 + edge_x +
+ (s->mb_width + 1) * (edge_y + 1);
uint32_t mv = AV_RN32A(get_bmv_ptr(edge, vp7_mv_pred[i].subblock));
if (mv) {
if (AV_RN32A(&near_mv[CNT_NEAREST])) {
@@ -1112,7 +1109,7 @@ void vp7_decode_mvs(VP8Context *s, VP8Macroblock *mb,
if (vpx_rac_get_prob_branchy(c, vp7_mode_contexts[cnt[CNT_NEAR]][3])) {
mb->mode = VP8_MVMODE_SPLIT;
- mb->mv = mb->bmv[decode_splitmvs(s, c, mb, layout, IS_VP7) - 1];
+ mb->mv = mb->bmv[decode_splitmvs(s, c, mb, 1, IS_VP7) - 1];
} else {
mb->mv.y += vp7_read_mv_component(c, s->prob->mvc[0]);
mb->mv.x += vp7_read_mv_component(c, s->prob->mvc[1]);
@@ -1310,7 +1307,7 @@ void decode_mb_mode(VP8Context *s, VP8mvbounds *mv_bounds,
} else {
const uint32_t modes = (is_vp7 ? vp7_pred4x4_mode
: vp8_pred4x4_mode)[mb->mode] * 0x01010101u;
- if (s->mb_layout)
+ if (is_vp7 || s->mb_layout)
AV_WN32A(mb->intra4x4_pred_mode_top, modes);
else
AV_WN32A(s->intra4x4_pred_mode_top + 4 * mb_x, modes);
@@ -1332,7 +1329,7 @@ void decode_mb_mode(VP8Context *s, VP8mvbounds *mv_bounds,
// motion vectors, 16.3
if (is_vp7)
- vp7_decode_mvs(s, mb, mb_x, mb_y, layout);
+ vp7_decode_mvs(s, mb, mb_x, mb_y);
else
vp8_decode_mvs(s, mv_bounds, mb, mb_x, mb_y, layout);
} else {
@@ -2420,7 +2417,7 @@ static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void
next_td = td;
else
next_td = &s->thread_data[(jobnr + 1) % num_jobs];
- if (s->mb_layout == 1)
+ if (is_vp7 || s->mb_layout == 1)
mb = s->macroblocks_base + ((s->mb_width + 1) * (mb_y + 1) + 1);
else {
// Make sure the previous frame has read its segmentation map,
@@ -2460,10 +2457,10 @@ static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void
s->vdsp.prefetch(dst[1] + (mb_x & 7) * s->uvlinesize + 64,
dst[2] - dst[1], 2);
- if (!s->mb_layout)
+ if (!is_vp7 && !s->mb_layout)
decode_mb_mode(s, &td->mv_bounds, mb, mb_x, mb_y, curframe->seg_map->data + mb_xy,
prev_frame && prev_frame->seg_map ?
- prev_frame->seg_map->data + mb_xy : NULL, 0, is_vp7);
+ prev_frame->seg_map->data + mb_xy : NULL, 0, IS_VP8);
prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP8_FRAME_PREVIOUS);
@@ -2547,7 +2544,7 @@ static av_always_inline void filter_mb_row(AVCodecContext *avctx, void *tdata,
curframe->data[2] + 8 * mb_y * s->uvlinesize
};
- if (s->mb_layout == 1)
+ if (is_vp7 || s->mb_layout == 1)
mb = s->macroblocks_base + ((s->mb_width + 1) * (mb_y + 1) + 1);
else
mb = s->macroblocks + (s->mb_height - mb_y - 1) * 2;
@@ -2770,17 +2767,18 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame,
s->uvlinesize = curframe->tf.f->linesize[1];
memset(s->top_nnz, 0, s->mb_width * sizeof(*s->top_nnz));
- /* Zero macroblock structures for top/top-left prediction
- * from outside the frame. */
- if (!s->mb_layout)
+ if (!is_vp7 && !s->mb_layout) {
+ /* Zero macroblock structures for top/top-left prediction
+ * from outside the frame. */
memset(s->macroblocks + s->mb_height * 2 - 1, 0,
(s->mb_width + 1) * sizeof(*s->macroblocks));
- if (!s->mb_layout && s->keyframe)
- memset(s->intra4x4_pred_mode_top, DC_PRED, s->mb_width * 4);
+ if (s->keyframe)
+ memset(s->intra4x4_pred_mode_top, DC_PRED, s->mb_width * 4);
+ }
memset(s->ref_count, 0, sizeof(s->ref_count));
- if (s->mb_layout == 1) {
+ if (is_vp7 || s->mb_layout == 1) {
if (is_vp7) {
ret = vp7_decode_mv_mb_modes(avctx, curframe, prev_frame);
} else {
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 05/18] avcodec/vp8: Inline inner_filter for VP7
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
` (2 preceding siblings ...)
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 04/18] avcodec/vp8: Inline mb_layout for VP7 Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 06/18] avcodec/vp8: Inline mbskip_enabled " Andreas Rheinhardt
` (12 subsequent siblings)
16 siblings, 0 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It is always true for VP7.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vp8.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 635e45f87e..35d75170f1 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2223,7 +2223,7 @@ void filter_mb(VP8Context *s, uint8_t *dst[3], VP8FilterStrength *f,
}
#define H_LOOP_FILTER_16Y_INNER(cond) \
- if (cond && inner_filter) { \
+ if (cond && (is_vp7 || inner_filter)) { \
s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0] + 4, linesize, \
bedge_lim_y, inner_limit, \
hev_thresh); \
@@ -2247,7 +2247,7 @@ void filter_mb(VP8Context *s, uint8_t *dst[3], VP8FilterStrength *f,
mbedge_lim, inner_limit, hev_thresh);
}
- if (inner_filter) {
+ if (is_vp7 || inner_filter) {
s->vp8dsp.vp8_v_loop_filter16y_inner(dst[0] + 4 * linesize,
linesize, bedge_lim_y,
inner_limit, hev_thresh);
@@ -2268,7 +2268,7 @@ void filter_mb(VP8Context *s, uint8_t *dst[3], VP8FilterStrength *f,
static av_always_inline
void filter_mb_simple(VP8Context *s, uint8_t *dst, VP8FilterStrength *f,
- int mb_x, int mb_y)
+ int mb_x, int mb_y, int is_vp7)
{
int mbedge_lim, bedge_lim;
int filter_level = f->filter_level;
@@ -2284,7 +2284,7 @@ void filter_mb_simple(VP8Context *s, uint8_t *dst, VP8FilterStrength *f,
if (mb_x)
s->vp8dsp.vp8_h_loop_filter_simple(dst, linesize, mbedge_lim);
- if (inner_filter) {
+ if (is_vp7 || inner_filter) {
s->vp8dsp.vp8_h_loop_filter_simple(dst + 4, linesize, bedge_lim);
s->vp8dsp.vp8_h_loop_filter_simple(dst + 8, linesize, bedge_lim);
s->vp8dsp.vp8_h_loop_filter_simple(dst + 12, linesize, bedge_lim);
@@ -2292,7 +2292,7 @@ void filter_mb_simple(VP8Context *s, uint8_t *dst, VP8FilterStrength *f,
if (mb_y)
s->vp8dsp.vp8_v_loop_filter_simple(dst, linesize, mbedge_lim);
- if (inner_filter) {
+ if (is_vp7 || inner_filter) {
s->vp8dsp.vp8_v_loop_filter_simple(dst + 4 * linesize, linesize, bedge_lim);
s->vp8dsp.vp8_v_loop_filter_simple(dst + 8 * linesize, linesize, bedge_lim);
s->vp8dsp.vp8_v_loop_filter_simple(dst + 12 * linesize, linesize, bedge_lim);
@@ -2577,7 +2577,7 @@ static av_always_inline void filter_mb_row(AVCodecContext *avctx, void *tdata,
}
if (s->filter.simple)
- filter_mb_simple(s, dst[0], f, mb_x, mb_y);
+ filter_mb_simple(s, dst[0], f, mb_x, mb_y, is_vp7);
else
filter_mb(s, dst, f, mb_x, mb_y, is_vp7);
dst[0] += 16;
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 06/18] avcodec/vp8: Inline mbskip_enabled for VP7
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
` (3 preceding siblings ...)
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 05/18] avcodec/vp8: Inline inner_filter " Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 07/18] avcodec/vp8: Pass mb_y explicitly Andreas Rheinhardt
` (11 subsequent siblings)
16 siblings, 0 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Always zero for VP7.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vp8.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 35d75170f1..c259f3588c 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -1296,7 +1296,7 @@ void decode_mb_mode(VP8Context *s, VP8mvbounds *mv_bounds,
*segment = ref ? *ref : *segment;
mb->segment = *segment;
- mb->skip = s->mbskip_enabled ? vpx_rac_get_prob(c, s->prob->mbskip) : 0;
+ mb->skip = !is_vp7 && s->mbskip_enabled ? vpx_rac_get_prob(c, s->prob->mbskip) : 0;
if (s->keyframe) {
mb->mode = vp89_rac_get_tree(c, vp8_pred16x16_tree_intra,
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 07/18] avcodec/vp8: Pass mb_y explicitly
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
` (4 preceding siblings ...)
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 06/18] avcodec/vp8: Inline mbskip_enabled " Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 08/18] avcodec/vp8: Inline num_coeff_partitions for VP7 Andreas Rheinhardt
` (10 subsequent siblings)
16 siblings, 0 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Avoids atomic stores and loads and is a prerequisite for
removing all atomic synchronizations for VP7.
Notice that removing the explicit atomic_store() in
vp78_decode_mb_row_sliced() does not negatively affect
parallelism during slice-threading, because no check_thread_pos()
ever waits for an (mb_x, mb_y) pair with mb_x == 0
(which this atomic store signalled).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
Btw: The code in update_pos looks fishy to me; namely
the part that tries to avoid the broadcast. Consider the scenario
in which the other threads (prev and next, A and B) are not waiting
when the current thread C checks their wait_mb_pos. Then
one of the other threads reads C's thread_mb_pos and notices that
it needs to wait for an update from C. It therefore locks C's mutex,
stores its wait_mb_pos, checks C's thread_mb_pos again (still reading
the old value in this scenario) and waits via pthread_cond_wait().
Then C updates its thread_mb_pos, but because C uses outdated values
for A and B's wait_mb_pos, it never signals a broadcast. Who will
then wake up the waiting thread?
This should be fixable by moving the loads after C's update
of thread_mb_pos: In case C's read of A's wait_mb_pos value happens
before A updates it, then C's update of its thread_mb_pos
happens before A updates its wait_mb_pos and A will therefore read
C's updated value of thread_mb_pos its atomic_load while holding
C's lock (and will therefore never call pthread_cond_wait()).
In case C's read of A's wait_mb_pos value happens after A updates it,
C will emit its broadcast, waking A which reads the updated value
and stops.
libavcodec/vp8.c | 30 +++++++++++++++---------------
libavcodec/vp8.h | 4 ++--
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index c259f3588c..5ecb9b07e5 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2389,11 +2389,11 @@ static int vp8_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *cur_frame,
#endif
static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
- int jobnr, int threadnr, int is_vp7)
+ int jobnr, int threadnr, int mb_y,
+ int is_vp7)
{
VP8Context *s = avctx->priv_data;
VP8ThreadData *prev_td, *next_td, *td = &s->thread_data[threadnr];
- int mb_y = atomic_load(&td->thread_mb_pos) >> 16;
int mb_x, mb_xy = mb_y * s->mb_width;
int num_jobs = s->num_jobs;
const VP8Frame *prev_frame = s->prev_frame;
@@ -2518,23 +2518,24 @@ static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void
}
static int vp7_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
- int jobnr, int threadnr)
+ int jobnr, int threadnr, int mb_y)
{
- return decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, 1);
+ return decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, mb_y, 1);
}
static int vp8_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
- int jobnr, int threadnr)
+ int jobnr, int threadnr, int mb_y)
{
- return decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, 0);
+ return decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, mb_y, 0);
}
static av_always_inline void filter_mb_row(AVCodecContext *avctx, void *tdata,
- int jobnr, int threadnr, int is_vp7)
+ int jobnr, int threadnr, int mb_y,
+ int is_vp7)
{
VP8Context *s = avctx->priv_data;
VP8ThreadData *td = &s->thread_data[threadnr];
- int mb_x, mb_y = atomic_load(&td->thread_mb_pos) >> 16, num_jobs = s->num_jobs;
+ int mb_x, num_jobs = s->num_jobs;
AVFrame *curframe = s->curframe->tf.f;
VP8Macroblock *mb;
VP8ThreadData *prev_td, *next_td;
@@ -2589,15 +2590,15 @@ static av_always_inline void filter_mb_row(AVCodecContext *avctx, void *tdata,
}
static void vp7_filter_mb_row(AVCodecContext *avctx, void *tdata,
- int jobnr, int threadnr)
+ int jobnr, int threadnr, int mb_y)
{
- filter_mb_row(avctx, tdata, jobnr, threadnr, 1);
+ filter_mb_row(avctx, tdata, jobnr, threadnr, mb_y, 1);
}
static void vp8_filter_mb_row(AVCodecContext *avctx, void *tdata,
- int jobnr, int threadnr)
+ int jobnr, int threadnr, int mb_y)
{
- filter_mb_row(avctx, tdata, jobnr, threadnr, 0);
+ filter_mb_row(avctx, tdata, jobnr, threadnr, mb_y, 0);
}
static av_always_inline
@@ -2615,14 +2616,13 @@ int vp78_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, int jobnr,
td->mv_bounds.mv_min.y = -MARGIN - 64 * threadnr;
td->mv_bounds.mv_max.y = ((s->mb_height - 1) << 6) + MARGIN - 64 * threadnr;
for (mb_y = jobnr; mb_y < s->mb_height; mb_y += num_jobs) {
- atomic_store(&td->thread_mb_pos, mb_y << 16);
- ret = s->decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr);
+ ret = s->decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, mb_y);
if (ret < 0) {
update_pos(td, s->mb_height, INT_MAX & 0xFFFF);
return ret;
}
if (s->deblock_filter)
- s->filter_mb_row(avctx, tdata, jobnr, threadnr);
+ s->filter_mb_row(avctx, tdata, jobnr, threadnr, mb_y);
update_pos(td, mb_y, INT_MAX & 0xFFFF);
td->mv_bounds.mv_min.y -= 64 * num_jobs;
diff --git a/libavcodec/vp8.h b/libavcodec/vp8.h
index 30aeb4cb06..ed79bc79c1 100644
--- a/libavcodec/vp8.h
+++ b/libavcodec/vp8.h
@@ -330,8 +330,8 @@ typedef struct VP8Context {
*/
int mb_layout;
- int (*decode_mb_row_no_filter)(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr);
- void (*filter_mb_row)(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr);
+ int (*decode_mb_row_no_filter)(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr, int mb_y);
+ void (*filter_mb_row)(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr, int mb_y);
int vp7;
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 08/18] avcodec/vp8: Inline num_coeff_partitions for VP7
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
` (5 preceding siblings ...)
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 07/18] avcodec/vp8: Pass mb_y explicitly Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 09/18] avcodec/vp8: Disable slice-thread synchronization code " Andreas Rheinhardt
` (9 subsequent siblings)
16 siblings, 0 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vp8.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 5ecb9b07e5..f5c05cd84f 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2398,7 +2398,7 @@ static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void
int num_jobs = s->num_jobs;
const VP8Frame *prev_frame = s->prev_frame;
VP8Frame *curframe = s->curframe;
- VPXRangeCoder *c = &s->coeff_partition[mb_y & (s->num_coeff_partitions - 1)];
+ VPXRangeCoder *c = &s->coeff_partition[is_vp7 ? 0 : mb_y & (s->num_coeff_partitions - 1)];
VP8Macroblock *mb;
uint8_t *dst[3] = {
curframe->tf.f->data[0] + 16 * mb_y * s->linesize,
@@ -2793,7 +2793,7 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame,
goto err;
}
- if (avctx->active_thread_type == FF_THREAD_FRAME)
+ if (is_vp7 || avctx->active_thread_type == FF_THREAD_FRAME)
num_jobs = 1;
else
num_jobs = FFMIN(s->num_coeff_partitions, avctx->thread_count);
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 09/18] avcodec/vp8: Disable slice-thread synchronization code for VP7
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
` (6 preceding siblings ...)
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 08/18] avcodec/vp8: Inline num_coeff_partitions for VP7 Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 10/18] avcodec/vp8: Inline num_jobs " Andreas Rheinhardt
` (8 subsequent siblings)
16 siblings, 0 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
The VP7 decoder is not slice-threaded; by its design, VP7
only allows at most two slice threads per frame and if it
were ever implemented, it would likely need custom synchronization
code anyway, so disable the current code for it.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vp8.c | 38 ++++++++++++++++++++------------------
1 file changed, 20 insertions(+), 18 deletions(-)
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index f5c05cd84f..dd3d38d342 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2440,7 +2440,7 @@ static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void
if (vpx_rac_is_end(c))
return AVERROR_INVALIDDATA;
// Wait for previous thread to read mb_x+2, and reach mb_y-1.
- if (prev_td != td) {
+ if (!is_vp7 && prev_td != td) {
if (threadnr != 0) {
check_thread_pos(td, prev_td,
mb_x + (is_vp7 ? 2 : 1),
@@ -2508,11 +2508,9 @@ static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void
td->mv_bounds.mv_min.x -= 64;
td->mv_bounds.mv_max.x -= 64;
- if (mb_x == s->mb_width + 1) {
- update_pos(td, mb_y, s->mb_width + 3);
- } else {
- update_pos(td, mb_y, mb_x);
- }
+ if (!is_vp7)
+ update_pos(td, mb_y, mb_x == s->mb_width + 1 ?
+ s->mb_width + 3 : mb_x);
}
return 0;
}
@@ -2561,10 +2559,10 @@ static av_always_inline void filter_mb_row(AVCodecContext *avctx, void *tdata,
for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb++) {
VP8FilterStrength *f = &td->filter_strength[mb_x];
- if (prev_td != td)
+ if (!is_vp7 && prev_td != td)
check_thread_pos(td, prev_td,
(mb_x + 1) + (s->mb_width + 3), mb_y - 1);
- if (next_td != td)
+ if (!is_vp7 && next_td != td)
if (next_td != &s->thread_data[0])
check_thread_pos(td, next_td, mb_x + 1, mb_y + 1);
@@ -2585,7 +2583,8 @@ static av_always_inline void filter_mb_row(AVCodecContext *avctx, void *tdata,
dst[1] += 8;
dst[2] += 8;
- update_pos(td, mb_y, (s->mb_width + 3) + mb_x);
+ if (!is_vp7)
+ update_pos(td, mb_y, (s->mb_width + 3) + mb_x);
}
}
@@ -2618,12 +2617,14 @@ int vp78_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, int jobnr,
for (mb_y = jobnr; mb_y < s->mb_height; mb_y += num_jobs) {
ret = s->decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, mb_y);
if (ret < 0) {
- update_pos(td, s->mb_height, INT_MAX & 0xFFFF);
+ if (!is_vp7)
+ update_pos(td, s->mb_height, INT_MAX & 0xFFFF);
return ret;
}
if (s->deblock_filter)
s->filter_mb_row(avctx, tdata, jobnr, threadnr, mb_y);
- update_pos(td, mb_y, INT_MAX & 0xFFFF);
+ if (!is_vp7)
+ update_pos(td, mb_y, INT_MAX & 0xFFFF);
td->mv_bounds.mv_min.y -= 64 * num_jobs;
td->mv_bounds.mv_max.y -= 64 * num_jobs;
@@ -2802,17 +2803,18 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame,
s->prev_frame = prev_frame;
s->mv_bounds.mv_min.y = -MARGIN;
s->mv_bounds.mv_max.y = ((s->mb_height - 1) << 6) + MARGIN;
- for (i = 0; i < MAX_THREADS; i++) {
- VP8ThreadData *td = &s->thread_data[i];
- atomic_init(&td->thread_mb_pos, 0);
- atomic_init(&td->wait_mb_pos, INT_MAX);
- }
- if (is_vp7)
+ if (is_vp7) {
avctx->execute2(avctx, vp7_decode_mb_row_sliced, s->thread_data, NULL,
num_jobs);
- else
+ } else {
+ for (unsigned i = 0; i < MAX_THREADS; i++) {
+ VP8ThreadData *td = &s->thread_data[i];
+ atomic_init(&td->thread_mb_pos, 0);
+ atomic_init(&td->wait_mb_pos, INT_MAX);
+ }
avctx->execute2(avctx, vp8_decode_mb_row_sliced, s->thread_data, NULL,
num_jobs);
+ }
}
ff_thread_report_progress(&curframe->tf, INT_MAX, 0);
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 10/18] avcodec/vp8: Inline num_jobs for VP7
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
` (7 preceding siblings ...)
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 09/18] avcodec/vp8: Disable slice-thread synchronization code " Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 11/18] avcodec/vp8: Inline jobnr, threadnr " Andreas Rheinhardt
` (7 subsequent siblings)
16 siblings, 0 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Always one.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vp8.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index dd3d38d342..ce824cec81 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2395,7 +2395,7 @@ static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void
VP8Context *s = avctx->priv_data;
VP8ThreadData *prev_td, *next_td, *td = &s->thread_data[threadnr];
int mb_x, mb_xy = mb_y * s->mb_width;
- int num_jobs = s->num_jobs;
+ int num_jobs = is_vp7 ? 1 : s->num_jobs;
const VP8Frame *prev_frame = s->prev_frame;
VP8Frame *curframe = s->curframe;
VPXRangeCoder *c = &s->coeff_partition[is_vp7 ? 0 : mb_y & (s->num_coeff_partitions - 1)];
@@ -2491,7 +2491,7 @@ static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void
if (s->deblock_filter)
filter_level_for_mb(s, mb, &td->filter_strength[mb_x], is_vp7);
- if (s->deblock_filter && num_jobs != 1 && threadnr == num_jobs - 1) {
+ if (s->deblock_filter && !is_vp7 && num_jobs != 1 && threadnr == num_jobs - 1) {
if (s->filter.simple)
backup_mb_border(s->top_border[mb_x + 1], dst[0],
NULL, NULL, s->linesize, 0, 1);
@@ -2533,7 +2533,7 @@ static av_always_inline void filter_mb_row(AVCodecContext *avctx, void *tdata,
{
VP8Context *s = avctx->priv_data;
VP8ThreadData *td = &s->thread_data[threadnr];
- int mb_x, num_jobs = s->num_jobs;
+ int mb_x, num_jobs = is_vp7 ? 1 : s->num_jobs;
AVFrame *curframe = s->curframe->tf.f;
VP8Macroblock *mb;
VP8ThreadData *prev_td, *next_td;
@@ -2566,7 +2566,7 @@ static av_always_inline void filter_mb_row(AVCodecContext *avctx, void *tdata,
if (next_td != &s->thread_data[0])
check_thread_pos(td, next_td, mb_x + 1, mb_y + 1);
- if (num_jobs == 1) {
+ if (is_vp7 || num_jobs == 1) {
if (s->filter.simple)
backup_mb_border(s->top_border[mb_x + 1], dst[0],
NULL, NULL, s->linesize, 0, 1);
@@ -2608,7 +2608,7 @@ int vp78_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, int jobnr,
VP8ThreadData *td = &s->thread_data[jobnr];
VP8ThreadData *next_td = NULL, *prev_td = NULL;
VP8Frame *curframe = s->curframe;
- int mb_y, num_jobs = s->num_jobs;
+ int mb_y, num_jobs = is_vp7 ? 1 : s->num_jobs;
int ret;
td->thread_nr = threadnr;
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 11/18] avcodec/vp8: Inline jobnr, threadnr for VP7
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
` (8 preceding siblings ...)
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 10/18] avcodec/vp8: Inline num_jobs " Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 12/18] avcodec/vp8: Inline update_last " Andreas Rheinhardt
` (6 subsequent siblings)
16 siblings, 0 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vp8.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index ce824cec81..ee30fc2846 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2518,7 +2518,7 @@ static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void
static int vp7_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
int jobnr, int threadnr, int mb_y)
{
- return decode_mb_row_no_filter(avctx, tdata, jobnr, threadnr, mb_y, 1);
+ return decode_mb_row_no_filter(avctx, tdata, 0, 0, mb_y, 1);
}
static int vp8_decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
@@ -2591,7 +2591,7 @@ static av_always_inline void filter_mb_row(AVCodecContext *avctx, void *tdata,
static void vp7_filter_mb_row(AVCodecContext *avctx, void *tdata,
int jobnr, int threadnr, int mb_y)
{
- filter_mb_row(avctx, tdata, jobnr, threadnr, mb_y, 1);
+ filter_mb_row(avctx, tdata, 0, 0, mb_y, 1);
}
static void vp8_filter_mb_row(AVCodecContext *avctx, void *tdata,
@@ -2639,7 +2639,7 @@ int vp78_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, int jobnr,
static int vp7_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata,
int jobnr, int threadnr)
{
- return vp78_decode_mb_row_sliced(avctx, tdata, jobnr, threadnr, IS_VP7);
+ return vp78_decode_mb_row_sliced(avctx, tdata, 0, 0, IS_VP7);
}
static int vp8_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata,
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 12/18] avcodec/vp8: Inline update_last for VP7
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
` (9 preceding siblings ...)
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 11/18] avcodec/vp8: Inline jobnr, threadnr " Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 13/18] avcodec/vp8: Don't use avctx->execute2 " Andreas Rheinhardt
` (5 subsequent siblings)
16 siblings, 0 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Always one.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vp8.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index ee30fc2846..1f0deddb1a 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2678,7 +2678,7 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame,
prev_frame = s->framep[VP8_FRAME_CURRENT];
- referenced = s->update_last || s->update_golden == VP8_FRAME_CURRENT ||
+ referenced = is_vp7 || s->update_last || s->update_golden == VP8_FRAME_CURRENT ||
s->update_altref == VP8_FRAME_CURRENT;
skip_thresh = !referenced ? AVDISCARD_NONREF
@@ -2740,7 +2740,7 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame,
else
s->next_framep[VP8_FRAME_GOLDEN] = s->framep[VP8_FRAME_GOLDEN];
- if (s->update_last)
+ if (is_vp7 || s->update_last)
s->next_framep[VP8_FRAME_PREVIOUS] = curframe;
else
s->next_framep[VP8_FRAME_PREVIOUS] = s->framep[VP8_FRAME_PREVIOUS];
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 13/18] avcodec/vp8: Don't use avctx->execute2 for VP7
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
` (10 preceding siblings ...)
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 12/18] avcodec/vp8: Inline update_last " Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 14/18] avcodec/vp8: Move fade_present from context to stack Andreas Rheinhardt
` (4 subsequent siblings)
16 siblings, 0 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Our decoder does not support slice-threading at all.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
vp7_decode_mb_row_sliced() btw can return errors which are currently
ignored (both before and after this patch).
libavcodec/vp8.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 1f0deddb1a..a7df4601ef 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -2636,8 +2636,7 @@ int vp78_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, int jobnr,
return 0;
}
-static int vp7_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata,
- int jobnr, int threadnr)
+static int vp7_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata)
{
return vp78_decode_mb_row_sliced(avctx, tdata, 0, 0, IS_VP7);
}
@@ -2804,8 +2803,7 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame,
s->mv_bounds.mv_min.y = -MARGIN;
s->mv_bounds.mv_max.y = ((s->mb_height - 1) << 6) + MARGIN;
if (is_vp7) {
- avctx->execute2(avctx, vp7_decode_mb_row_sliced, s->thread_data, NULL,
- num_jobs);
+ vp7_decode_mb_row_sliced(avctx, s->thread_data);
} else {
for (unsigned i = 0; i < MAX_THREADS; i++) {
VP8ThreadData *td = &s->thread_data[i];
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 14/18] avcodec/vp8: Move fade_present from context to stack
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
` (11 preceding siblings ...)
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 13/18] avcodec/vp8: Don't use avctx->execute2 " Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 15/18] avcodec/vp8: Disable frame-threading code for VP7 Andreas Rheinhardt
` (3 subsequent siblings)
16 siblings, 0 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
It is only an auxiliary value used for parsing the VP7 frame header.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
I think that vp7_fade_frame() needs a check for whether the
previous frame is writable before writing to it.
Does anyone have a sample for this fading?
libavcodec/vp8.c | 6 +++---
libavcodec/vp8.h | 5 -----
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index a7df4601ef..baf9820ce6 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -580,6 +580,7 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
int height = s->avctx->height;
int alpha = 0;
int beta = 0;
+ int fade_present = 1;
if (buf_size < 4) {
return AVERROR_INVALIDDATA;
@@ -679,7 +680,6 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
s->update_last = 1;
s->update_probabilities = 1;
- s->fade_present = 1;
if (s->profile > 0) {
s->update_probabilities = vp89_rac_get(c);
@@ -687,13 +687,13 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
s->prob[1] = s->prob[0];
if (!s->keyframe)
- s->fade_present = vp89_rac_get(c);
+ fade_present = vp89_rac_get(c);
}
if (vpx_rac_is_end(c))
return AVERROR_INVALIDDATA;
/* E. Fading information for previous frame */
- if (s->fade_present && vp89_rac_get(c)) {
+ if (fade_present && vp89_rac_get(c)) {
alpha = (int8_t) vp89_rac_get_uint(c, 8);
beta = (int8_t) vp89_rac_get_uint(c, 8);
}
diff --git a/libavcodec/vp8.h b/libavcodec/vp8.h
index ed79bc79c1..db0155237a 100644
--- a/libavcodec/vp8.h
+++ b/libavcodec/vp8.h
@@ -335,11 +335,6 @@ typedef struct VP8Context {
int vp7;
- /**
- * Fade bit present in bitstream (VP7)
- */
- int fade_present;
-
/**
* Interframe DC prediction (VP7)
* [0] VP8_FRAME_PREVIOUS
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 15/18] avcodec/vp8: Disable frame-threading code for VP7
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
` (12 preceding siblings ...)
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 14/18] avcodec/vp8: Move fade_present from context to stack Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 16/18] avcodec/vp8dsp: Remove declarations of inexistent functions Andreas Rheinhardt
` (2 subsequent siblings)
16 siblings, 0 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
The VP7 decoder does not support frame threading.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vp8.c | 55 ++++++++++++++++++++++++++----------------------
1 file changed, 30 insertions(+), 25 deletions(-)
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index baf9820ce6..91f3238245 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -1836,7 +1836,7 @@ void vp8_mc_luma(VP8Context *s, VP8ThreadData *td, uint8_t *dst,
const ThreadFrame *ref, const VP8mv *mv,
int x_off, int y_off, int block_w, int block_h,
int width, int height, ptrdiff_t linesize,
- vp8_mc_func mc_func[3][3])
+ vp8_mc_func mc_func[3][3], int is_vp7)
{
uint8_t *src = ref->f->data[0];
@@ -1850,7 +1850,8 @@ void vp8_mc_luma(VP8Context *s, VP8ThreadData *td, uint8_t *dst,
y_off += mv->y >> 2;
// edge emulation
- ff_thread_await_progress(ref, (3 + y_off + block_h + subpel_idx[2][my]) >> 4, 0);
+ if (!is_vp7)
+ ff_thread_await_progress(ref, (3 + y_off + block_h + subpel_idx[2][my]) >> 4, 0);
src += y_off * linesize + x_off;
if (x_off < mx_idx || x_off >= width - block_w - subpel_idx[2][mx] ||
y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
@@ -1866,7 +1867,8 @@ void vp8_mc_luma(VP8Context *s, VP8ThreadData *td, uint8_t *dst,
}
mc_func[my_idx][mx_idx](dst, linesize, src, src_linesize, block_h, mx, my);
} else {
- ff_thread_await_progress(ref, (3 + y_off + block_h) >> 4, 0);
+ if (!is_vp7)
+ ff_thread_await_progress(ref, (3 + y_off + block_h) >> 4, 0);
mc_func[0][0](dst, linesize, src + y_off * linesize + x_off,
linesize, block_h, 0, 0);
}
@@ -1894,7 +1896,7 @@ void vp8_mc_chroma(VP8Context *s, VP8ThreadData *td, uint8_t *dst1,
uint8_t *dst2, const ThreadFrame *ref, const VP8mv *mv,
int x_off, int y_off, int block_w, int block_h,
int width, int height, ptrdiff_t linesize,
- vp8_mc_func mc_func[3][3])
+ vp8_mc_func mc_func[3][3], int is_vp7)
{
uint8_t *src1 = ref->f->data[1], *src2 = ref->f->data[2];
@@ -1908,7 +1910,8 @@ void vp8_mc_chroma(VP8Context *s, VP8ThreadData *td, uint8_t *dst1,
// edge emulation
src1 += y_off * linesize + x_off;
src2 += y_off * linesize + x_off;
- ff_thread_await_progress(ref, (3 + y_off + block_h + subpel_idx[2][my]) >> 3, 0);
+ if (!is_vp7)
+ ff_thread_await_progress(ref, (3 + y_off + block_h + subpel_idx[2][my]) >> 3, 0);
if (x_off < mx_idx || x_off >= width - block_w - subpel_idx[2][mx] ||
y_off < my_idx || y_off >= height - block_h - subpel_idx[2][my]) {
s->vdsp.emulated_edge_mc(td->edge_emu_buffer,
@@ -1933,7 +1936,8 @@ void vp8_mc_chroma(VP8Context *s, VP8ThreadData *td, uint8_t *dst1,
mc_func[my_idx][mx_idx](dst2, linesize, src2, linesize, block_h, mx, my);
}
} else {
- ff_thread_await_progress(ref, (3 + y_off + block_h) >> 3, 0);
+ if (!is_vp7)
+ ff_thread_await_progress(ref, (3 + y_off + block_h) >> 3, 0);
mc_func[0][0](dst1, linesize, src1 + y_off * linesize + x_off, linesize, block_h, 0, 0);
mc_func[0][0](dst2, linesize, src2 + y_off * linesize + x_off, linesize, block_h, 0, 0);
}
@@ -1943,7 +1947,7 @@ static av_always_inline
void vp8_mc_part(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
ThreadFrame *ref_frame, int x_off, int y_off,
int bx_off, int by_off, int block_w, int block_h,
- int width, int height, VP8mv *mv)
+ int width, int height, VP8mv *mv, int is_vp7)
{
VP8mv uvmv = *mv;
@@ -1951,7 +1955,7 @@ void vp8_mc_part(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
vp8_mc_luma(s, td, dst[0] + by_off * s->linesize + bx_off,
ref_frame, mv, x_off + bx_off, y_off + by_off,
block_w, block_h, width, height, s->linesize,
- s->put_pixels_tab[block_w == 8]);
+ s->put_pixels_tab[block_w == 8], is_vp7);
/* U/V */
if (s->profile == 3) {
@@ -1972,7 +1976,7 @@ void vp8_mc_part(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
dst[2] + by_off * s->uvlinesize + bx_off, ref_frame,
&uvmv, x_off + bx_off, y_off + by_off,
block_w, block_h, width, height, s->uvlinesize,
- s->put_pixels_tab[1 + (block_w == 4)]);
+ s->put_pixels_tab[1 + (block_w == 4)], is_vp7);
}
/* Fetch pixels for estimated mv 4 macroblocks ahead.
@@ -2002,7 +2006,7 @@ void prefetch_motion(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y,
*/
static av_always_inline
void inter_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
- VP8Macroblock *mb, int mb_x, int mb_y)
+ VP8Macroblock *mb, int mb_x, int mb_y, int is_vp7)
{
int x_off = mb_x << 4, y_off = mb_y << 4;
int width = 16 * s->mb_width, height = 16 * s->mb_height;
@@ -2012,7 +2016,7 @@ void inter_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
switch (mb->partitioning) {
case VP8_SPLITMVMODE_NONE:
vp8_mc_part(s, td, dst, ref, x_off, y_off,
- 0, 0, 16, 16, width, height, &mb->mv);
+ 0, 0, 16, 16, width, height, &mb->mv, is_vp7);
break;
case VP8_SPLITMVMODE_4x4: {
int x, y;
@@ -2025,7 +2029,7 @@ void inter_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
ref, &bmv[4 * y + x],
4 * x + x_off, 4 * y + y_off, 4, 4,
width, height, s->linesize,
- s->put_pixels_tab[2]);
+ s->put_pixels_tab[2], is_vp7);
}
}
@@ -2054,32 +2058,32 @@ void inter_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
dst[2] + 4 * y * s->uvlinesize + x * 4, ref,
&uvmv, 4 * x + x_off, 4 * y + y_off, 4, 4,
width, height, s->uvlinesize,
- s->put_pixels_tab[2]);
+ s->put_pixels_tab[2], is_vp7);
}
}
break;
}
case VP8_SPLITMVMODE_16x8:
vp8_mc_part(s, td, dst, ref, x_off, y_off,
- 0, 0, 16, 8, width, height, &bmv[0]);
+ 0, 0, 16, 8, width, height, &bmv[0], is_vp7);
vp8_mc_part(s, td, dst, ref, x_off, y_off,
- 0, 8, 16, 8, width, height, &bmv[1]);
+ 0, 8, 16, 8, width, height, &bmv[1], is_vp7);
break;
case VP8_SPLITMVMODE_8x16:
vp8_mc_part(s, td, dst, ref, x_off, y_off,
- 0, 0, 8, 16, width, height, &bmv[0]);
+ 0, 0, 8, 16, width, height, &bmv[0], is_vp7);
vp8_mc_part(s, td, dst, ref, x_off, y_off,
- 8, 0, 8, 16, width, height, &bmv[1]);
+ 8, 0, 8, 16, width, height, &bmv[1], is_vp7);
break;
case VP8_SPLITMVMODE_8x8:
vp8_mc_part(s, td, dst, ref, x_off, y_off,
- 0, 0, 8, 8, width, height, &bmv[0]);
+ 0, 0, 8, 8, width, height, &bmv[0], is_vp7);
vp8_mc_part(s, td, dst, ref, x_off, y_off,
- 8, 0, 8, 8, width, height, &bmv[1]);
+ 8, 0, 8, 8, width, height, &bmv[1], is_vp7);
vp8_mc_part(s, td, dst, ref, x_off, y_off,
- 0, 8, 8, 8, width, height, &bmv[2]);
+ 0, 8, 8, 8, width, height, &bmv[2], is_vp7);
vp8_mc_part(s, td, dst, ref, x_off, y_off,
- 8, 8, 8, 8, width, height, &bmv[3]);
+ 8, 8, 8, 8, width, height, &bmv[3], is_vp7);
break;
}
}
@@ -2470,7 +2474,7 @@ static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void
if (mb->mode <= MODE_I4x4)
intra_predict(s, td, dst, mb, mb_x, mb_y, is_vp7);
else
- inter_predict(s, td, dst, mb, mb_x, mb_y);
+ inter_predict(s, td, dst, mb, mb_x, mb_y, is_vp7);
prefetch_motion(s, mb, mb_x, mb_y, mb_xy, VP8_FRAME_GOLDEN);
@@ -2629,7 +2633,7 @@ int vp78_decode_mb_row_sliced(AVCodecContext *avctx, void *tdata, int jobnr,
td->mv_bounds.mv_min.y -= 64 * num_jobs;
td->mv_bounds.mv_max.y -= 64 * num_jobs;
- if (avctx->active_thread_type == FF_THREAD_FRAME)
+ if (!is_vp7 && avctx->active_thread_type == FF_THREAD_FRAME)
ff_thread_report_progress(&curframe->tf, mb_y, 0);
}
@@ -2746,7 +2750,7 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame,
s->next_framep[VP8_FRAME_CURRENT] = curframe;
- if (ffcodec(avctx->codec)->update_thread_context)
+ if (!is_vp7 && ffcodec(avctx->codec)->update_thread_context)
ff_thread_finish_setup(avctx);
if (avctx->hwaccel) {
@@ -2815,7 +2819,8 @@ int vp78_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame,
}
}
- ff_thread_report_progress(&curframe->tf, INT_MAX, 0);
+ if (!is_vp7)
+ ff_thread_report_progress(&curframe->tf, INT_MAX, 0);
memcpy(&s->framep[0], &s->next_framep[0], sizeof(s->framep[0]) * 4);
skip_decode:
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 16/18] avcodec/vp8dsp: Remove declarations of inexistent functions
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
` (13 preceding siblings ...)
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 15/18] avcodec/vp8: Disable frame-threading code for VP7 Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 17/18] avcodec/vp8dsp: Constify src in vp8_mc_func Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 18/18] avcodec/vp8: Add const where appropriate Andreas Rheinhardt
16 siblings, 0 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Forgotten in d6f8476be4895c620d58e021ab880823d2fe25bf.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vp8dsp.h | 7 -------
1 file changed, 7 deletions(-)
diff --git a/libavcodec/vp8dsp.h b/libavcodec/vp8dsp.h
index 7c6208df39..bbd7f60a4f 100644
--- a/libavcodec/vp8dsp.h
+++ b/libavcodec/vp8dsp.h
@@ -81,13 +81,6 @@ typedef struct VP8DSPContext {
vp8_mc_func put_vp8_bilinear_pixels_tab[3][3][3];
} VP8DSPContext;
-void ff_put_vp8_pixels16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
- int h, int x, int y);
-void ff_put_vp8_pixels8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
- int h, int x, int y);
-void ff_put_vp8_pixels4_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
- int h, int x, int y);
-
void ff_vp7dsp_init(VP8DSPContext *c);
void ff_vp78dsp_init(VP8DSPContext *c);
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 17/18] avcodec/vp8dsp: Constify src in vp8_mc_func
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
` (14 preceding siblings ...)
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 16/18] avcodec/vp8dsp: Remove declarations of inexistent functions Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 18/18] avcodec/vp8: Add const where appropriate Andreas Rheinhardt
16 siblings, 0 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/aarch64/vp8dsp.h | 2 +-
libavcodec/arm/vp8dsp.h | 2 +-
libavcodec/arm/vp8dsp_armv6.S | 6 +-
libavcodec/loongarch/vp8_mc_lsx.c | 31 ++---
libavcodec/loongarch/vp8dsp_loongarch.h | 28 ++---
libavcodec/mips/vp8_mc_msa.c | 110 +++++++++---------
libavcodec/mips/vp8dsp_mips.h | 144 ++++++++++++------------
libavcodec/ppc/vp8dsp_altivec.c | 12 +-
libavcodec/vp8dsp.c | 14 +--
libavcodec/vp8dsp.h | 2 +-
libavcodec/x86/vp8dsp.asm | 2 +-
libavcodec/x86/vp8dsp_init.c | 58 +++++-----
12 files changed, 206 insertions(+), 205 deletions(-)
diff --git a/libavcodec/aarch64/vp8dsp.h b/libavcodec/aarch64/vp8dsp.h
index 871fed7a95..4e59de28b1 100644
--- a/libavcodec/aarch64/vp8dsp.h
+++ b/libavcodec/aarch64/vp8dsp.h
@@ -53,7 +53,7 @@
#define VP8_MC(n, opt) \
void ff_put_vp8_##n##_##opt(uint8_t *dst, ptrdiff_t dststride, \
- uint8_t *src, ptrdiff_t srcstride, \
+ const uint8_t *src, ptrdiff_t srcstride,\
int h, int x, int y)
#define VP8_EPEL(w, opt) \
diff --git a/libavcodec/arm/vp8dsp.h b/libavcodec/arm/vp8dsp.h
index 7281d0bfb1..11dcc78d7a 100644
--- a/libavcodec/arm/vp8dsp.h
+++ b/libavcodec/arm/vp8dsp.h
@@ -58,7 +58,7 @@ void ff_vp8dsp_init_neon(VP8DSPContext *dsp);
#define VP8_MC(n, opt) \
void ff_put_vp8_##n##_##opt(uint8_t *dst, ptrdiff_t dststride, \
- uint8_t *src, ptrdiff_t srcstride, \
+ const uint8_t *src, ptrdiff_t srcstride,\
int h, int x, int y)
#define VP8_EPEL(w, opt) \
diff --git a/libavcodec/arm/vp8dsp_armv6.S b/libavcodec/arm/vp8dsp_armv6.S
index 2320bf4d23..395debe866 100644
--- a/libavcodec/arm/vp8dsp_armv6.S
+++ b/libavcodec/arm/vp8dsp_armv6.S
@@ -1113,7 +1113,7 @@ endfunc
@ MC
-@ void put_vp8_pixels16(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
+@ void put_vp8_pixels16(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src,
@ ptrdiff_t srcstride, int h, int mx, int my)
function ff_put_vp8_pixels16_armv6, export=1
push {r4-r11}
@@ -1137,7 +1137,7 @@ function ff_put_vp8_pixels16_armv6, export=1
bx lr
endfunc
-@ void put_vp8_pixels8(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
+@ void put_vp8_pixels8(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src,
@ ptrdiff_t srcstride, int h, int mx, int my)
function ff_put_vp8_pixels8_armv6, export=1
push {r4-r11}
@@ -1161,7 +1161,7 @@ function ff_put_vp8_pixels8_armv6, export=1
bx lr
endfunc
-@ void put_vp8_pixels4(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
+@ void put_vp8_pixels4(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src,
@ ptrdiff_t srcstride, int h, int mx, int my)
function ff_put_vp8_pixels4_armv6, export=1
ldr r12, [sp, #0] @ h
diff --git a/libavcodec/loongarch/vp8_mc_lsx.c b/libavcodec/loongarch/vp8_mc_lsx.c
index 80c4f87e80..034d84cc5d 100644
--- a/libavcodec/loongarch/vp8_mc_lsx.c
+++ b/libavcodec/loongarch/vp8_mc_lsx.c
@@ -122,7 +122,7 @@ static const int8_t subpel_filters_lsx[7][8] = {
} )
void ff_put_vp8_epel8_h6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -187,7 +187,7 @@ void ff_put_vp8_epel8_h6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel16_h6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -241,7 +241,7 @@ void ff_put_vp8_epel16_h6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel8_v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -308,7 +308,7 @@ void ff_put_vp8_epel8_v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel16_v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -389,7 +389,7 @@ void ff_put_vp8_epel16_v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel8_h6v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -491,7 +491,7 @@ void ff_put_vp8_epel8_h6v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel16_h6v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
int32_t multiple8_cnt;
@@ -504,7 +504,7 @@ void ff_put_vp8_epel16_h6v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel8_v4_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -561,7 +561,7 @@ void ff_put_vp8_epel8_v4_lsx(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel16_v4_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -631,7 +631,7 @@ void ff_put_vp8_epel16_v4_lsx(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel8_h6v4_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -714,7 +714,7 @@ void ff_put_vp8_epel8_h6v4_lsx(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel16_h6v4_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
int32_t multiple8_cnt;
@@ -728,7 +728,7 @@ void ff_put_vp8_epel16_h6v4_lsx(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel8_h4v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -818,7 +818,7 @@ void ff_put_vp8_epel8_h4v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel16_h4v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
int32_t multiple8_cnt;
@@ -832,7 +832,7 @@ void ff_put_vp8_epel16_h4v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_pixels8_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
int32_t cnt;
@@ -889,12 +889,13 @@ void ff_put_vp8_pixels8_lsx(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_pixels16_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
int32_t width = 16;
int32_t cnt, loop_cnt;
- uint8_t *src_tmp, *dst_tmp;
+ const uint8_t *src_tmp;
+ uint8_t *dst_tmp;
__m128i src0, src1, src2, src3, src4, src5, src6, src7;
ptrdiff_t src_stride2 = src_stride << 1;
diff --git a/libavcodec/loongarch/vp8dsp_loongarch.h b/libavcodec/loongarch/vp8dsp_loongarch.h
index 87e9509db9..09c7e1f91d 100644
--- a/libavcodec/loongarch/vp8dsp_loongarch.h
+++ b/libavcodec/loongarch/vp8dsp_loongarch.h
@@ -25,49 +25,49 @@
#include "libavcodec/vp8dsp.h"
void ff_put_vp8_pixels8_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int h, int x, int y);
void ff_put_vp8_pixels16_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int h, int x, int y);
void ff_put_vp8_epel16_h6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel16_v4_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel16_v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel16_h6v4_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel16_h4v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel16_h6v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel8_v4_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel8_v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel8_h6v4_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel8_h4v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel8_h6v6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
void ff_put_vp8_epel8_h6_lsx(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int my);
/* loop filter */
diff --git a/libavcodec/mips/vp8_mc_msa.c b/libavcodec/mips/vp8_mc_msa.c
index a61320625a..be1997f7dd 100644
--- a/libavcodec/mips/vp8_mc_msa.c
+++ b/libavcodec/mips/vp8_mc_msa.c
@@ -156,7 +156,7 @@ static const int8_t bilinear_filters_msa[7][2] = {
out0, out1, out2, out3); \
}
-static void common_hz_6t_4x4_msa(uint8_t *src, int32_t src_stride,
+static void common_hz_6t_4x4_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter)
{
@@ -184,7 +184,7 @@ static void common_hz_6t_4x4_msa(uint8_t *src, int32_t src_stride,
ST_W4(out, 0, 1, 2, 3, dst, dst_stride);
}
-static void common_hz_6t_4x8_msa(uint8_t *src, int32_t src_stride,
+static void common_hz_6t_4x8_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter)
{
@@ -220,7 +220,7 @@ static void common_hz_6t_4x8_msa(uint8_t *src, int32_t src_stride,
}
void ff_put_vp8_epel4_h6_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
const int8_t *filter = subpel_filters_msa[mx - 1];
@@ -233,7 +233,7 @@ void ff_put_vp8_epel4_h6_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel8_h6_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -281,7 +281,7 @@ void ff_put_vp8_epel8_h6_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel16_h6_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -330,7 +330,7 @@ void ff_put_vp8_epel16_h6_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel4_v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -377,7 +377,7 @@ void ff_put_vp8_epel4_v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel8_v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -427,7 +427,7 @@ void ff_put_vp8_epel8_v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel16_v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -501,7 +501,7 @@ void ff_put_vp8_epel16_v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel4_h6v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -576,7 +576,7 @@ void ff_put_vp8_epel4_h6v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel8_h6v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -663,7 +663,7 @@ void ff_put_vp8_epel8_h6v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
void ff_put_vp8_epel16_h6v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
int32_t multiple8_cnt;
@@ -677,7 +677,7 @@ void ff_put_vp8_epel16_h6v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
}
-static void common_hz_4t_4x4_msa(uint8_t *src, int32_t src_stride,
+static void common_hz_4t_4x4_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter)
{
@@ -704,7 +704,7 @@ static void common_hz_4t_4x4_msa(uint8_t *src, int32_t src_stride,
ST_W4(out, 0, 1, 2, 3, dst, dst_stride);
}
-static void common_hz_4t_4x8_msa(uint8_t *src, int32_t src_stride,
+static void common_hz_4t_4x8_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter)
{
@@ -739,7 +739,7 @@ static void common_hz_4t_4x8_msa(uint8_t *src, int32_t src_stride,
ST_W4(out, 0, 1, 2, 3, dst + 4 * dst_stride, dst_stride);
}
-static void common_hz_4t_4x16_msa(uint8_t *src, int32_t src_stride,
+static void common_hz_4t_4x16_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter)
{
@@ -790,7 +790,7 @@ static void common_hz_4t_4x16_msa(uint8_t *src, int32_t src_stride,
}
void ff_put_vp8_epel4_h4_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
const int8_t *filter = subpel_filters_msa[mx - 1];
@@ -805,7 +805,7 @@ void ff_put_vp8_epel4_h4_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel8_h4_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -840,7 +840,7 @@ void ff_put_vp8_epel8_h4_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel16_h4_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -889,7 +889,7 @@ void ff_put_vp8_epel16_h4_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel4_v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -936,7 +936,7 @@ void ff_put_vp8_epel4_v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel8_v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -982,7 +982,7 @@ void ff_put_vp8_epel8_v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel16_v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -1041,7 +1041,7 @@ void ff_put_vp8_epel16_v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel4_h4v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -1100,7 +1100,7 @@ void ff_put_vp8_epel4_h4v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel8_h4v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -1167,7 +1167,7 @@ void ff_put_vp8_epel8_h4v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel16_h4v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
int32_t multiple8_cnt;
@@ -1182,7 +1182,7 @@ void ff_put_vp8_epel16_h4v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel4_h6v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -1248,7 +1248,7 @@ void ff_put_vp8_epel4_h6v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel8_h6v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -1321,7 +1321,7 @@ void ff_put_vp8_epel8_h6v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel16_h6v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
int32_t multiple8_cnt;
@@ -1336,7 +1336,7 @@ void ff_put_vp8_epel16_h6v4_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel4_h4v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -1400,7 +1400,7 @@ void ff_put_vp8_epel4_h4v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel8_h4v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -1475,7 +1475,7 @@ void ff_put_vp8_epel8_h4v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_epel16_h4v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
int32_t multiple8_cnt;
@@ -1489,7 +1489,7 @@ void ff_put_vp8_epel16_h4v6_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
}
-static void common_hz_2t_4x4_msa(uint8_t *src, int32_t src_stride,
+static void common_hz_2t_4x4_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter)
{
@@ -1512,7 +1512,7 @@ static void common_hz_2t_4x4_msa(uint8_t *src, int32_t src_stride,
ST_W2(res1, 0, 1, dst + 2 * dst_stride, dst_stride);
}
-static void common_hz_2t_4x8_msa(uint8_t *src, int32_t src_stride,
+static void common_hz_2t_4x8_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter)
{
@@ -1542,7 +1542,7 @@ static void common_hz_2t_4x8_msa(uint8_t *src, int32_t src_stride,
}
void ff_put_vp8_bilinear4_h_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
const int8_t *filter = bilinear_filters_msa[mx - 1];
@@ -1554,7 +1554,7 @@ void ff_put_vp8_bilinear4_h_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
}
-static void common_hz_2t_8x4_msa(uint8_t *src, int32_t src_stride,
+static void common_hz_2t_8x4_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter)
{
@@ -1578,7 +1578,7 @@ static void common_hz_2t_8x4_msa(uint8_t *src, int32_t src_stride,
ST_D4(src0, src1, 0, 1, 0, 1, dst, dst_stride);
}
-static void common_hz_2t_8x8mult_msa(uint8_t *src, int32_t src_stride,
+static void common_hz_2t_8x8mult_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter, int32_t height)
{
@@ -1642,7 +1642,7 @@ static void common_hz_2t_8x8mult_msa(uint8_t *src, int32_t src_stride,
}
void ff_put_vp8_bilinear8_h_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
const int8_t *filter = bilinear_filters_msa[mx - 1];
@@ -1656,7 +1656,7 @@ void ff_put_vp8_bilinear8_h_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_bilinear16_h_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -1722,7 +1722,7 @@ void ff_put_vp8_bilinear16_h_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
}
-static void common_vt_2t_4x4_msa(uint8_t *src, int32_t src_stride,
+static void common_vt_2t_4x4_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter)
{
@@ -1748,7 +1748,7 @@ static void common_vt_2t_4x4_msa(uint8_t *src, int32_t src_stride,
ST_W4(src2110, 0, 1, 2, 3, dst, dst_stride);
}
-static void common_vt_2t_4x8_msa(uint8_t *src, int32_t src_stride,
+static void common_vt_2t_4x8_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter)
{
@@ -1783,7 +1783,7 @@ static void common_vt_2t_4x8_msa(uint8_t *src, int32_t src_stride,
}
void ff_put_vp8_bilinear4_v_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
const int8_t *filter = bilinear_filters_msa[my - 1];
@@ -1795,7 +1795,7 @@ void ff_put_vp8_bilinear4_v_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
}
-static void common_vt_2t_8x4_msa(uint8_t *src, int32_t src_stride,
+static void common_vt_2t_8x4_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter)
{
@@ -1819,7 +1819,7 @@ static void common_vt_2t_8x4_msa(uint8_t *src, int32_t src_stride,
ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride);
}
-static void common_vt_2t_8x8mult_msa(uint8_t *src, int32_t src_stride,
+static void common_vt_2t_8x8mult_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter, int32_t height)
{
@@ -1865,7 +1865,7 @@ static void common_vt_2t_8x8mult_msa(uint8_t *src, int32_t src_stride,
}
void ff_put_vp8_bilinear8_v_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
const int8_t *filter = bilinear_filters_msa[my - 1];
@@ -1879,7 +1879,7 @@ void ff_put_vp8_bilinear8_v_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_bilinear16_v_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -1932,7 +1932,7 @@ void ff_put_vp8_bilinear16_v_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
}
-static void common_hv_2ht_2vt_4x4_msa(uint8_t *src, int32_t src_stride,
+static void common_hv_2ht_2vt_4x4_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter_horiz,
const int8_t *filter_vert)
@@ -1966,7 +1966,7 @@ static void common_hv_2ht_2vt_4x4_msa(uint8_t *src, int32_t src_stride,
ST_W2(res1, 0, 1, dst + 2 * dst_stride, dst_stride);
}
-static void common_hv_2ht_2vt_4x8_msa(uint8_t *src, int32_t src_stride,
+static void common_hv_2ht_2vt_4x8_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter_horiz,
const int8_t *filter_vert)
@@ -2014,7 +2014,7 @@ static void common_hv_2ht_2vt_4x8_msa(uint8_t *src, int32_t src_stride,
}
void ff_put_vp8_bilinear4_hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
const int8_t *filter_horiz = bilinear_filters_msa[mx - 1];
@@ -2029,7 +2029,7 @@ void ff_put_vp8_bilinear4_hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
}
-static void common_hv_2ht_2vt_8x4_msa(uint8_t *src, int32_t src_stride,
+static void common_hv_2ht_2vt_8x4_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter_horiz,
const int8_t *filter_vert)
@@ -2073,7 +2073,7 @@ static void common_hv_2ht_2vt_8x4_msa(uint8_t *src, int32_t src_stride,
ST_D4(out0, out1, 0, 1, 0, 1, dst, dst_stride);
}
-static void common_hv_2ht_2vt_8x8mult_msa(uint8_t *src, int32_t src_stride,
+static void common_hv_2ht_2vt_8x8mult_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
const int8_t *filter_horiz,
const int8_t *filter_vert,
@@ -2154,7 +2154,7 @@ static void common_hv_2ht_2vt_8x8mult_msa(uint8_t *src, int32_t src_stride,
}
void ff_put_vp8_bilinear8_hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
const int8_t *filter_horiz = bilinear_filters_msa[mx - 1];
@@ -2170,7 +2170,7 @@ void ff_put_vp8_bilinear8_hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_bilinear16_hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
uint32_t loop_cnt;
@@ -2241,7 +2241,7 @@ void ff_put_vp8_bilinear16_hv_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
void ff_put_vp8_pixels8_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
int32_t cnt;
@@ -2283,16 +2283,16 @@ void ff_put_vp8_pixels8_msa(uint8_t *dst, ptrdiff_t dst_stride,
}
}
-static void copy_16multx8mult_msa(uint8_t *src, int32_t src_stride,
+static void copy_16multx8mult_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
int32_t height, int32_t width)
{
int32_t cnt, loop_cnt;
- uint8_t *src_tmp, *dst_tmp;
+ uint8_t *dst_tmp;
v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
for (cnt = (width >> 4); cnt--;) {
- src_tmp = src;
+ const uint8_t *src_tmp = src;
dst_tmp = dst;
for (loop_cnt = (height >> 3); loop_cnt--;) {
@@ -2311,7 +2311,7 @@ static void copy_16multx8mult_msa(uint8_t *src, int32_t src_stride,
}
void ff_put_vp8_pixels16_msa(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int height, int mx, int my)
{
int32_t cnt;
diff --git a/libavcodec/mips/vp8dsp_mips.h b/libavcodec/mips/vp8dsp_mips.h
index 07666ab7a0..3d88db897a 100644
--- a/libavcodec/mips/vp8dsp_mips.h
+++ b/libavcodec/mips/vp8dsp_mips.h
@@ -28,118 +28,118 @@
#include "constants.h"
void ff_put_vp8_pixels4_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int x, int y);
void ff_put_vp8_pixels8_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int x, int y);
void ff_put_vp8_pixels16_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int x, int y);
void ff_put_vp8_epel16_h4_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel16_h6_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel16_v4_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel16_v6_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel16_h4v4_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel16_h6v4_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel16_h4v6_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel16_h6v6_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel8_h4_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel8_h6_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel8_v4_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel8_v6_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel8_h4v4_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel8_h6v4_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel8_h4v6_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel8_h6v6_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel4_h4_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel4_h6_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel4_v4_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel4_v6_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel4_h4v4_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel4_h6v4_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel4_h4v6_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_epel4_h6v6_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_bilinear16_h_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_bilinear16_v_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_bilinear16_hv_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_bilinear8_h_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_bilinear8_v_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_bilinear8_hv_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_bilinear4_h_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_bilinear4_v_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
void ff_put_vp8_bilinear4_hv_msa(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int h, int mx, int my);
/* loop filter */
@@ -184,84 +184,84 @@ void ff_vp8_idct_dc_add4y_mmi(uint8_t *dst, int16_t block[4][16],
void ff_vp8_idct_dc_add4uv_mmi(uint8_t *dst, int16_t block[4][16],
ptrdiff_t stride);
-void ff_put_vp8_pixels4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
+void ff_put_vp8_pixels4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src,
ptrdiff_t srcstride, int h, int x, int y);
-void ff_put_vp8_pixels8_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
+void ff_put_vp8_pixels8_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src,
ptrdiff_t srcstride, int h, int x, int y);
-void ff_put_vp8_pixels16_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
+void ff_put_vp8_pixels16_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src,
ptrdiff_t srcstride, int h, int x, int y);
-void ff_put_vp8_epel16_h4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
+void ff_put_vp8_epel16_h4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src,
ptrdiff_t srcstride, int h, int mx, int my);
-void ff_put_vp8_epel16_h6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
+void ff_put_vp8_epel16_h6_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src,
ptrdiff_t srcstride, int h, int mx, int my);
-void ff_put_vp8_epel16_v4_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
+void ff_put_vp8_epel16_v4_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src,
ptrdiff_t srcstride, int h, int mx, int my);
-void ff_put_vp8_epel16_v6_mmi(uint8_t *dst, ptrdiff_t dststride, uint8_t *src,
+void ff_put_vp8_epel16_v6_mmi(uint8_t *dst, ptrdiff_t dststride, const uint8_t *src,
ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel16_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel16_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel16_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel16_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel8_h4_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel8_h6_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel8_v4_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel8_v6_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel8_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel8_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel8_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel8_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel4_h4_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel4_h6_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel4_v4_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel4_v6_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel4_h4v4_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel4_h6v4_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel4_h4v6_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_epel4_h6v6_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_bilinear16_h_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_bilinear16_v_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_bilinear16_hv_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_bilinear8_h_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_bilinear8_v_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_bilinear8_hv_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_bilinear4_h_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_bilinear4_v_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
void ff_put_vp8_bilinear4_hv_mmi(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
+ const uint8_t *src, ptrdiff_t srcstride, int h, int mx, int my);
// loop filter applied to edges between macroblocks
void ff_vp8_v_loop_filter16_mmi(uint8_t *dst, ptrdiff_t stride, int flim_E,
diff --git a/libavcodec/ppc/vp8dsp_altivec.c b/libavcodec/ppc/vp8dsp_altivec.c
index 273de84778..12dac8b0a8 100644
--- a/libavcodec/ppc/vp8dsp_altivec.c
+++ b/libavcodec/ppc/vp8dsp_altivec.c
@@ -96,7 +96,7 @@ static const vec_s8 h_subpel_filters_outer[3] =
static av_always_inline
void put_vp8_epel_h_altivec_core(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int h, int mx, int w, int is6tap)
{
LOAD_H_SUBPEL_FILTER(mx-1);
@@ -193,7 +193,7 @@ static const vec_u8 v_subpel_filters[7] =
static av_always_inline
void put_vp8_epel_v_altivec_core(uint8_t *dst, ptrdiff_t dst_stride,
- uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
int h, int my, int w, int is6tap)
{
LOAD_V_SUBPEL_FILTER(my-1);
@@ -259,19 +259,19 @@ void put_vp8_epel_v_altivec_core(uint8_t *dst, ptrdiff_t dst_stride,
#define EPEL_FUNCS(WIDTH, TAPS) \
static av_noinline \
-void put_vp8_epel ## WIDTH ## _h ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my) \
+void put_vp8_epel ## WIDTH ## _h ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my) \
{ \
put_vp8_epel_h_altivec_core(dst, dst_stride, src, src_stride, h, mx, WIDTH, TAPS == 6); \
} \
\
static av_noinline \
-void put_vp8_epel ## WIDTH ## _v ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my) \
+void put_vp8_epel ## WIDTH ## _v ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my) \
{ \
put_vp8_epel_v_altivec_core(dst, dst_stride, src, src_stride, h, my, WIDTH, TAPS == 6); \
}
#define EPEL_HV(WIDTH, HTAPS, VTAPS) \
-static void put_vp8_epel ## WIDTH ## _h ## HTAPS ## v ## VTAPS ## _altivec(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) \
+static void put_vp8_epel ## WIDTH ## _h ## HTAPS ## v ## VTAPS ## _altivec(uint8_t *dst, ptrdiff_t dstride, const uint8_t *src, ptrdiff_t sstride, int h, int mx, int my) \
{ \
DECLARE_ALIGNED(16, uint8_t, tmp)[(2*WIDTH+5)*16]; \
if (VTAPS == 6) { \
@@ -299,7 +299,7 @@ EPEL_HV(4, 4,6)
EPEL_HV(4, 6,4)
EPEL_HV(4, 4,4)
-static void put_vp8_pixels16_altivec(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, ptrdiff_t sstride, int h, int mx, int my)
+static void put_vp8_pixels16_altivec(uint8_t *dst, ptrdiff_t dstride, const uint8_t *src, ptrdiff_t sstride, int h, int mx, int my)
{
register vector unsigned char perm;
int i;
diff --git a/libavcodec/vp8dsp.c b/libavcodec/vp8dsp.c
index a92774ed5e..7a85e9f4ca 100644
--- a/libavcodec/vp8dsp.c
+++ b/libavcodec/vp8dsp.c
@@ -468,7 +468,7 @@ static const uint8_t subpel_filters[7][6] = {
#define PUT_PIXELS(WIDTH) \
static void put_vp8_pixels ## WIDTH ## _c(uint8_t *dst, ptrdiff_t dststride, \
- uint8_t *src, ptrdiff_t srcstride, \
+ const uint8_t *src, ptrdiff_t srcstride, \
int h, int x, int y) \
{ \
int i; \
@@ -492,7 +492,7 @@ PUT_PIXELS(4)
#define VP8_EPEL_H(SIZE, TAPS) \
static void put_vp8_epel ## SIZE ## _h ## TAPS ## _c(uint8_t *dst, \
ptrdiff_t dststride, \
- uint8_t *src, \
+ const uint8_t *src, \
ptrdiff_t srcstride, \
int h, int mx, int my) \
{ \
@@ -510,7 +510,7 @@ static void put_vp8_epel ## SIZE ## _h ## TAPS ## _c(uint8_t *dst, \
#define VP8_EPEL_V(SIZE, TAPS) \
static void put_vp8_epel ## SIZE ## _v ## TAPS ## _c(uint8_t *dst, \
ptrdiff_t dststride, \
- uint8_t *src, \
+ const uint8_t *src, \
ptrdiff_t srcstride, \
int h, int mx, int my) \
{ \
@@ -529,7 +529,7 @@ static void put_vp8_epel ## SIZE ## _v ## TAPS ## _c(uint8_t *dst, \
static void \
put_vp8_epel ## SIZE ## _h ## HTAPS ## v ## VTAPS ## _c(uint8_t *dst, \
ptrdiff_t dststride, \
- uint8_t *src, \
+ const uint8_t *src, \
ptrdiff_t srcstride, \
int h, int mx, \
int my) \
@@ -586,7 +586,7 @@ VP8_EPEL_HV(4, 6, 6)
#define VP8_BILINEAR(SIZE) \
static void put_vp8_bilinear ## SIZE ## _h_c(uint8_t *dst, ptrdiff_t dstride, \
- uint8_t *src, ptrdiff_t sstride, \
+ const uint8_t *src, ptrdiff_t sstride, \
int h, int mx, int my) \
{ \
int a = 8 - mx, b = mx; \
@@ -600,7 +600,7 @@ static void put_vp8_bilinear ## SIZE ## _h_c(uint8_t *dst, ptrdiff_t dstride, \
} \
\
static void put_vp8_bilinear ## SIZE ## _v_c(uint8_t *dst, ptrdiff_t dstride, \
- uint8_t *src, ptrdiff_t sstride, \
+ const uint8_t *src, ptrdiff_t sstride, \
int h, int mx, int my) \
{ \
int c = 8 - my, d = my; \
@@ -615,7 +615,7 @@ static void put_vp8_bilinear ## SIZE ## _v_c(uint8_t *dst, ptrdiff_t dstride, \
\
static void put_vp8_bilinear ## SIZE ## _hv_c(uint8_t *dst, \
ptrdiff_t dstride, \
- uint8_t *src, \
+ const uint8_t *src, \
ptrdiff_t sstride, \
int h, int mx, int my) \
{ \
diff --git a/libavcodec/vp8dsp.h b/libavcodec/vp8dsp.h
index bbd7f60a4f..16b5e9c35b 100644
--- a/libavcodec/vp8dsp.h
+++ b/libavcodec/vp8dsp.h
@@ -31,7 +31,7 @@
#include <stdint.h>
typedef void (*vp8_mc_func)(uint8_t *dst /* align 8 */, ptrdiff_t dstStride,
- uint8_t *src /* align 1 */, ptrdiff_t srcStride,
+ const uint8_t *src /* align 1 */, ptrdiff_t srcStride,
int h, int x, int y);
typedef struct VP8DSPContext {
diff --git a/libavcodec/x86/vp8dsp.asm b/libavcodec/x86/vp8dsp.asm
index 1c59e884ed..33d488bf6f 100644
--- a/libavcodec/x86/vp8dsp.asm
+++ b/libavcodec/x86/vp8dsp.asm
@@ -157,7 +157,7 @@ SECTION .text
; subpel MC functions:
;
; void ff_put_vp8_epel<size>_h<htap>v<vtap>_<opt>(uint8_t *dst, ptrdiff_t deststride,
-; uint8_t *src, ptrdiff_t srcstride,
+; const uint8_t *src, ptrdiff_t srcstride,
; int height, int mx, int my);
;-------------------------------------------------------------------------------
diff --git a/libavcodec/x86/vp8dsp_init.c b/libavcodec/x86/vp8dsp_init.c
index cceb346ced..bd20da1fc9 100644
--- a/libavcodec/x86/vp8dsp_init.c
+++ b/libavcodec/x86/vp8dsp_init.c
@@ -32,93 +32,93 @@
* MC functions
*/
void ff_put_vp8_epel4_h4_mmxext(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_epel4_h6_mmxext(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_epel4_v4_mmxext(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_epel4_v6_mmxext(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_epel8_h4_sse2 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_epel8_h6_sse2 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_epel8_v4_sse2 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_epel8_v6_sse2 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_epel4_h4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_epel4_h6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_epel4_v4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_epel4_v6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_epel8_h4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_epel8_h6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_epel8_v4_ssse3 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_epel8_v6_ssse3 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_bilinear4_h_mmxext(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_bilinear8_h_sse2 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_bilinear4_h_ssse3 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_bilinear8_h_ssse3 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_bilinear4_v_mmxext(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_bilinear8_v_sse2 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_bilinear4_v_ssse3 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_bilinear8_v_ssse3 (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_pixels8_mmx (uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
void ff_put_vp8_pixels16_sse(uint8_t *dst, ptrdiff_t dststride,
- uint8_t *src, ptrdiff_t srcstride,
+ const uint8_t *src, ptrdiff_t srcstride,
int height, int mx, int my);
#define TAP_W16(OPT, FILTERTYPE, TAPTYPE) \
static void ff_put_vp8_ ## FILTERTYPE ## 16_ ## TAPTYPE ## _ ## OPT( \
- uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
+ uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, \
ptrdiff_t srcstride, int height, int mx, int my) \
{ \
ff_put_vp8_ ## FILTERTYPE ## 8_ ## TAPTYPE ## _ ## OPT( \
@@ -149,7 +149,7 @@ TAP_W16(ssse3, bilinear, v)
#define HVTAP(OPT, ALIGN, TAPNUMX, TAPNUMY, SIZE, MAXHEIGHT) \
static void ff_put_vp8_epel ## SIZE ## _h ## TAPNUMX ## v ## TAPNUMY ## _ ## OPT( \
- uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
+ uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, \
ptrdiff_t srcstride, int height, int mx, int my) \
{ \
LOCAL_ALIGNED(ALIGN, uint8_t, tmp, [SIZE * (MAXHEIGHT + TAPNUMY - 1)]); \
@@ -186,7 +186,7 @@ HVTAP(ssse3, 16, 6, 6, 4, 8)
#define HVBILIN(OPT, ALIGN, SIZE, MAXHEIGHT) \
static void ff_put_vp8_bilinear ## SIZE ## _hv_ ## OPT( \
- uint8_t *dst, ptrdiff_t dststride, uint8_t *src, \
+ uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, \
ptrdiff_t srcstride, int height, int mx, int my) \
{ \
LOCAL_ALIGNED(ALIGN, uint8_t, tmp, [SIZE * (MAXHEIGHT + 2)]); \
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* [FFmpeg-devel] [PATCH 18/18] avcodec/vp8: Add const where appropriate
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
` (15 preceding siblings ...)
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 17/18] avcodec/vp8dsp: Constify src in vp8_mc_func Andreas Rheinhardt
@ 2022-09-10 1:07 ` Andreas Rheinhardt
16 siblings, 0 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-10 1:07 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/vp8.c | 101 ++++++++++++++++++++++++-----------------------
1 file changed, 51 insertions(+), 50 deletions(-)
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 91f3238245..22707e2f28 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -132,7 +132,7 @@ static void vp8_release_frame(VP8Context *s, VP8Frame *f)
}
#if CONFIG_VP8_DECODER
-static int vp8_ref_frame(VP8Context *s, VP8Frame *dst, VP8Frame *src)
+static int vp8_ref_frame(VP8Context *s, VP8Frame *dst, const VP8Frame *src)
{
int ret;
@@ -508,7 +508,7 @@ static void update_refs(VP8Context *s)
s->update_altref = ref_to_update(s, update_altref, VP8_FRAME_ALTREF);
}
-static void copy_chroma(AVFrame *dst, AVFrame *src, int width, int height)
+static void copy_chroma(AVFrame *dst, const AVFrame *src, int width, int height)
{
int i, j;
@@ -542,7 +542,8 @@ static int vp7_fade_frame(VP8Context *s, int alpha, int beta)
if (!s->keyframe && (alpha || beta)) {
int width = s->mb_width * 16;
int height = s->mb_height * 16;
- AVFrame *src, *dst;
+ const AVFrame *src;
+ AVFrame *dst;
if (!s->framep[VP8_FRAME_PREVIOUS] ||
!s->framep[VP8_FRAME_GOLDEN]) {
@@ -550,8 +551,8 @@ static int vp7_fade_frame(VP8Context *s, int alpha, int beta)
return AVERROR_INVALIDDATA;
}
- dst =
- src = s->framep[VP8_FRAME_PREVIOUS]->tf.f;
+ src =
+ dst = s->framep[VP8_FRAME_PREVIOUS]->tf.f;
/* preserve the golden frame, write a new previous frame */
if (s->framep[VP8_FRAME_GOLDEN] == s->framep[VP8_FRAME_PREVIOUS]) {
@@ -875,7 +876,7 @@ static int vp8_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
}
static av_always_inline
-void clamp_mv(VP8mvbounds *s, VP8mv *dst, const VP8mv *src)
+void clamp_mv(const VP8mvbounds *s, VP8mv *dst, const VP8mv *src)
{
dst->x = av_clip(src->x, av_clip(s->mv_min.x, INT16_MIN, INT16_MAX),
av_clip(s->mv_max.x, INT16_MIN, INT16_MAX));
@@ -942,18 +943,18 @@ const uint8_t *get_submv_prob(uint32_t left, uint32_t top, int is_vp7)
* @returns the number of motion vectors parsed (2, 4 or 16)
*/
static av_always_inline
-int decode_splitmvs(VP8Context *s, VPXRangeCoder *c, VP8Macroblock *mb,
+int decode_splitmvs(const VP8Context *s, VPXRangeCoder *c, VP8Macroblock *mb,
int layout, int is_vp7)
{
int part_idx;
int n, num;
- VP8Macroblock *top_mb;
- VP8Macroblock *left_mb = &mb[-1];
+ const VP8Macroblock *top_mb;
+ const VP8Macroblock *left_mb = &mb[-1];
const uint8_t *mbsplits_left = vp8_mbsplits[left_mb->partitioning];
const uint8_t *mbsplits_top, *mbsplits_cur, *firstidx;
- VP8mv *top_mv;
- VP8mv *left_mv = left_mb->bmv;
- VP8mv *cur_mv = mb->bmv;
+ const VP8mv *top_mv;
+ const VP8mv *left_mv = left_mb->bmv;
+ const VP8mv *cur_mv = mb->bmv;
if (!layout) // layout is inlined, s->mb_layout is not
top_mb = &mb[2];
@@ -1046,7 +1047,6 @@ static av_always_inline
void vp7_decode_mvs(VP8Context *s, VP8Macroblock *mb,
int mb_x, int mb_y)
{
- VP8Macroblock *mb_edge[12];
enum { CNT_ZERO, CNT_NEAREST, CNT_NEAR };
enum { VP8_EDGE_TOP, VP8_EDGE_LEFT, VP8_EDGE_TOPLEFT };
int idx = CNT_ZERO;
@@ -1065,7 +1065,7 @@ void vp7_decode_mvs(VP8Context *s, VP8Macroblock *mb,
if (vp7_calculate_mb_offset(mb_x, mb_y, s->mb_width, pred->xoffset,
pred->yoffset, !s->profile, &edge_x, &edge_y)) {
- VP8Macroblock *edge = mb_edge[i] = s->macroblocks_base + 1 + edge_x +
+ const VP8Macroblock *edge = s->macroblocks_base + 1 + edge_x +
(s->mb_width + 1) * (edge_y + 1);
uint32_t mv = AV_RN32A(get_bmv_ptr(edge, vp7_mv_pred[i].subblock));
if (mv) {
@@ -1131,7 +1131,7 @@ void vp7_decode_mvs(VP8Context *s, VP8Macroblock *mb,
}
static av_always_inline
-void vp8_decode_mvs(VP8Context *s, VP8mvbounds *mv_bounds, VP8Macroblock *mb,
+void vp8_decode_mvs(VP8Context *s, const VP8mvbounds *mv_bounds, VP8Macroblock *mb,
int mb_x, int mb_y, int layout)
{
VP8Macroblock *mb_edge[3] = { 0 /* top */,
@@ -1141,7 +1141,7 @@ void vp8_decode_mvs(VP8Context *s, VP8mvbounds *mv_bounds, VP8Macroblock *mb,
enum { VP8_EDGE_TOP, VP8_EDGE_LEFT, VP8_EDGE_TOPLEFT };
int idx = CNT_ZERO;
int cur_sign_bias = s->sign_bias[mb->ref_frame];
- int8_t *sign_bias = s->sign_bias;
+ const int8_t *sign_bias = s->sign_bias;
VP8mv near_mv[4];
uint8_t cnt[4] = { 0 };
VPXRangeCoder *c = &s->c;
@@ -1161,7 +1161,7 @@ void vp8_decode_mvs(VP8Context *s, VP8mvbounds *mv_bounds, VP8Macroblock *mb,
/* Process MB on top, left and top-left */
#define MV_EDGE_CHECK(n) \
{ \
- VP8Macroblock *edge = mb_edge[n]; \
+ const VP8Macroblock *edge = mb_edge[n]; \
int edge_ref = edge->ref_frame; \
if (edge_ref != VP8_FRAME_CURRENT) { \
uint32_t mv = AV_RN32A(&edge->mv); \
@@ -1266,7 +1266,7 @@ void decode_intra4x4_modes(VP8Context *s, VPXRangeCoder *c, VP8Macroblock *mb,
}
static av_always_inline
-void decode_mb_mode(VP8Context *s, VP8mvbounds *mv_bounds,
+void decode_mb_mode(VP8Context *s, const VP8mvbounds *mv_bounds,
VP8Macroblock *mb, int mb_x, int mb_y,
uint8_t *segment, const uint8_t *ref, int layout, int is_vp7)
{
@@ -1361,7 +1361,7 @@ void decode_mb_mode(VP8Context *s, VP8mvbounds *mv_bounds,
static av_always_inline
int decode_block_coeffs_internal(VPXRangeCoder *r, int16_t block[16],
uint8_t probs[16][3][NUM_DCT_TOKENS - 1],
- int i, uint8_t *token_prob, int16_t qmul[2],
+ int i, const uint8_t *token_prob, const int16_t qmul[2],
const uint8_t scan[16], int vp7)
{
VPXRangeCoder c = *r;
@@ -1444,8 +1444,8 @@ int inter_predict_dc(int16_t block[16], int16_t pred[2])
static int vp7_decode_block_coeffs_internal(VPXRangeCoder *r,
int16_t block[16],
uint8_t probs[16][3][NUM_DCT_TOKENS - 1],
- int i, uint8_t *token_prob,
- int16_t qmul[2],
+ int i, const uint8_t *token_prob,
+ const int16_t qmul[2],
const uint8_t scan[16])
{
return decode_block_coeffs_internal(r, block, probs, i,
@@ -1456,8 +1456,8 @@ static int vp7_decode_block_coeffs_internal(VPXRangeCoder *r,
static int vp8_decode_block_coeffs_internal(VPXRangeCoder *r,
int16_t block[16],
uint8_t probs[16][3][NUM_DCT_TOKENS - 1],
- int i, uint8_t *token_prob,
- int16_t qmul[2])
+ int i, const uint8_t *token_prob,
+ const int16_t qmul[2])
{
return decode_block_coeffs_internal(r, block, probs, i,
token_prob, qmul, ff_zigzag_scan, IS_VP8);
@@ -1480,10 +1480,10 @@ static int vp8_decode_block_coeffs_internal(VPXRangeCoder *r,
static av_always_inline
int decode_block_coeffs(VPXRangeCoder *c, int16_t block[16],
uint8_t probs[16][3][NUM_DCT_TOKENS - 1],
- int i, int zero_nhood, int16_t qmul[2],
+ int i, int zero_nhood, const int16_t qmul[2],
const uint8_t scan[16], int vp7)
{
- uint8_t *token_prob = probs[i][zero_nhood];
+ const uint8_t *token_prob = probs[i][zero_nhood];
if (!vpx_rac_get_prob_branchy(c, token_prob[0])) // DCT_EOB
return 0;
return vp7 ? vp7_decode_block_coeffs_internal(c, block, probs, i,
@@ -1568,8 +1568,8 @@ void decode_mb_coeffs(VP8Context *s, VP8ThreadData *td, VPXRangeCoder *c,
}
static av_always_inline
-void backup_mb_border(uint8_t *top_border, uint8_t *src_y,
- uint8_t *src_cb, uint8_t *src_cr,
+void backup_mb_border(uint8_t *top_border, const uint8_t *src_y,
+ const uint8_t *src_cb, const uint8_t *src_cr,
ptrdiff_t linesize, ptrdiff_t uvlinesize, int simple)
{
AV_COPY128(top_border, src_y + 15 * linesize);
@@ -1694,7 +1694,7 @@ int check_intra_pred4x4_mode_emuedge(int mode, int mb_x, int mb_y,
}
static av_always_inline
-void intra_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
+void intra_predict(VP8Context *s, VP8ThreadData *td, uint8_t *const dst[3],
VP8Macroblock *mb, int mb_x, int mb_y, int is_vp7)
{
int x, y, mode, nnz;
@@ -1712,14 +1712,14 @@ void intra_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
s->hpc.pred16x16[mode](dst[0], s->linesize);
} else {
uint8_t *ptr = dst[0];
- uint8_t *intra4x4 = mb->intra4x4_pred_mode_mb;
+ const uint8_t *intra4x4 = mb->intra4x4_pred_mode_mb;
const uint8_t lo = is_vp7 ? 128 : 127;
const uint8_t hi = is_vp7 ? 128 : 129;
- uint8_t tr_top[4] = { lo, lo, lo, lo };
+ const uint8_t tr_top[4] = { lo, lo, lo, lo };
// all blocks on the right edge of the macroblock use bottom edge
// the top macroblock for their topright edge
- uint8_t *tr_right = ptr - s->linesize + 16;
+ const uint8_t *tr_right = ptr - s->linesize + 16;
// if we're on the right edge of the frame, said edge is extended
// from the top macroblock
@@ -1732,7 +1732,7 @@ void intra_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
AV_ZERO128(td->non_zero_count_cache);
for (y = 0; y < 4; y++) {
- uint8_t *topright = ptr + 4 - s->linesize;
+ const uint8_t *topright = ptr + 4 - s->linesize;
for (x = 0; x < 4; x++) {
int copy = 0;
ptrdiff_t linesize = s->linesize;
@@ -1838,7 +1838,7 @@ void vp8_mc_luma(VP8Context *s, VP8ThreadData *td, uint8_t *dst,
int width, int height, ptrdiff_t linesize,
vp8_mc_func mc_func[3][3], int is_vp7)
{
- uint8_t *src = ref->f->data[0];
+ const uint8_t *src = ref->f->data[0];
if (AV_RN32A(mv)) {
ptrdiff_t src_linesize = linesize;
@@ -1898,7 +1898,7 @@ void vp8_mc_chroma(VP8Context *s, VP8ThreadData *td, uint8_t *dst1,
int width, int height, ptrdiff_t linesize,
vp8_mc_func mc_func[3][3], int is_vp7)
{
- uint8_t *src1 = ref->f->data[1], *src2 = ref->f->data[2];
+ const uint8_t *src1 = ref->f->data[1], *src2 = ref->f->data[2];
if (AV_RN32A(mv)) {
int mx = mv->x & 7, mx_idx = subpel_idx[0][mx];
@@ -1944,10 +1944,10 @@ void vp8_mc_chroma(VP8Context *s, VP8ThreadData *td, uint8_t *dst1,
}
static av_always_inline
-void vp8_mc_part(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
- ThreadFrame *ref_frame, int x_off, int y_off,
+void vp8_mc_part(VP8Context *s, VP8ThreadData *td, uint8_t *const dst[3],
+ const ThreadFrame *ref_frame, int x_off, int y_off,
int bx_off, int by_off, int block_w, int block_h,
- int width, int height, VP8mv *mv, int is_vp7)
+ int width, int height, const VP8mv *mv, int is_vp7)
{
VP8mv uvmv = *mv;
@@ -1982,8 +1982,8 @@ void vp8_mc_part(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
/* Fetch pixels for estimated mv 4 macroblocks ahead.
* Optimized for 64-byte cache lines. Inspired by ffh264 prefetch_motion. */
static av_always_inline
-void prefetch_motion(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y,
- int mb_xy, int ref)
+void prefetch_motion(const VP8Context *s, const VP8Macroblock *mb,
+ int mb_x, int mb_y, int mb_xy, int ref)
{
/* Don't prefetch refs that haven't been used very often this frame. */
if (s->ref_count[ref - 1] > (mb_xy >> 5)) {
@@ -2005,13 +2005,13 @@ void prefetch_motion(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y,
* Apply motion vectors to prediction buffer, chapter 18.
*/
static av_always_inline
-void inter_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
+void inter_predict(VP8Context *s, VP8ThreadData *td, uint8_t *const dst[3],
VP8Macroblock *mb, int mb_x, int mb_y, int is_vp7)
{
int x_off = mb_x << 4, y_off = mb_y << 4;
int width = 16 * s->mb_width, height = 16 * s->mb_height;
- ThreadFrame *ref = &s->framep[mb->ref_frame]->tf;
- VP8mv *bmv = mb->bmv;
+ const ThreadFrame *ref = &s->framep[mb->ref_frame]->tf;
+ const VP8mv *bmv = mb->bmv;
switch (mb->partitioning) {
case VP8_SPLITMVMODE_NONE:
@@ -2089,7 +2089,8 @@ void inter_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
}
static av_always_inline
-void idct_mb(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3], VP8Macroblock *mb)
+void idct_mb(VP8Context *s, VP8ThreadData *td, uint8_t *const dst[3],
+ const VP8Macroblock *mb)
{
int x, y, ch;
@@ -2151,7 +2152,7 @@ chroma_idct_end:
}
static av_always_inline
-void filter_level_for_mb(VP8Context *s, VP8Macroblock *mb,
+void filter_level_for_mb(const VP8Context *s, const VP8Macroblock *mb,
VP8FilterStrength *f, int is_vp7)
{
int interior_limit, filter_level;
@@ -2184,7 +2185,7 @@ void filter_level_for_mb(VP8Context *s, VP8Macroblock *mb,
}
static av_always_inline
-void filter_mb(VP8Context *s, uint8_t *dst[3], VP8FilterStrength *f,
+void filter_mb(const VP8Context *s, uint8_t *const dst[3], const VP8FilterStrength *f,
int mb_x, int mb_y, int is_vp7)
{
int mbedge_lim, bedge_lim_y, bedge_lim_uv, hev_thresh;
@@ -2271,7 +2272,7 @@ void filter_mb(VP8Context *s, uint8_t *dst[3], VP8FilterStrength *f,
}
static av_always_inline
-void filter_mb_simple(VP8Context *s, uint8_t *dst, VP8FilterStrength *f,
+void filter_mb_simple(const VP8Context *s, uint8_t *dst, const VP8FilterStrength *f,
int mb_x, int mb_y, int is_vp7)
{
int mbedge_lim, bedge_lim;
@@ -2306,7 +2307,7 @@ void filter_mb_simple(VP8Context *s, uint8_t *dst, VP8FilterStrength *f,
#define MARGIN (16 << 2)
static av_always_inline
int vp78_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *curframe,
- VP8Frame *prev_frame, int is_vp7)
+ const VP8Frame *prev_frame, int is_vp7)
{
VP8Context *s = avctx->priv_data;
int mb_x, mb_y;
@@ -2343,13 +2344,13 @@ int vp78_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *curframe,
}
static int vp7_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *cur_frame,
- VP8Frame *prev_frame)
+ const VP8Frame *prev_frame)
{
return vp78_decode_mv_mb_modes(avctx, cur_frame, prev_frame, IS_VP7);
}
static int vp8_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *cur_frame,
- VP8Frame *prev_frame)
+ const VP8Frame *prev_frame)
{
return vp78_decode_mv_mb_modes(avctx, cur_frame, prev_frame, IS_VP8);
}
@@ -2562,7 +2563,7 @@ static av_always_inline void filter_mb_row(AVCodecContext *avctx, void *tdata,
next_td = &s->thread_data[(jobnr + 1) % num_jobs];
for (mb_x = 0; mb_x < s->mb_width; mb_x++, mb++) {
- VP8FilterStrength *f = &td->filter_strength[mb_x];
+ const VP8FilterStrength *f = &td->filter_strength[mb_x];
if (!is_vp7 && prev_td != td)
check_thread_pos(td, prev_td,
(mb_x + 1) + (s->mb_width + 3), mb_y - 1);
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [FFmpeg-devel] [PATCH 02/18] avcodec/vp8: Disable lf_delta for VP7
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 02/18] avcodec/vp8: Disable lf_delta " Andreas Rheinhardt
@ 2022-09-11 4:29 ` Peter Ross
2022-09-11 4:38 ` Andreas Rheinhardt
0 siblings, 1 reply; 23+ messages in thread
From: Peter Ross @ 2022-09-11 4:29 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Andreas Rheinhardt
[-- Attachment #1.1: Type: text/plain, Size: 1479 bytes --]
On Sat, Sep 10, 2022 at 03:07:13AM +0200, Andreas Rheinhardt wrote:
> It is a VP8-only feature.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> libavcodec/vp8.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
> index c00c5c975e..04a2113cc8 100644
> --- a/libavcodec/vp8.c
> +++ b/libavcodec/vp8.c
> @@ -637,7 +637,6 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
> for (i = 0; i < 2; i++)
> memcpy(s->prob->mvc[i], vp7_mv_default_prob[i],
> sizeof(vp7_mv_default_prob[i]));
> - memset(&s->lf_delta, 0, sizeof(s->lf_delta));
> memcpy(s->prob[0].scan, ff_zigzag_scan, sizeof(s->prob[0].scan));
> }
>
> @@ -2171,7 +2170,7 @@ void filter_level_for_mb(VP8Context *s, VP8Macroblock *mb,
> } else
> filter_level = s->filter.level;
>
> - if (s->lf_delta.enabled) {
> + if (!is_vp7 && s->lf_delta.enabled) {
> filter_level += s->lf_delta.ref[mb->ref_frame];
> filter_level += s->lf_delta.mode[mb->mode];
> }
what's the motivation for patches 01 and 02?
are you not just adding another condition (is_vp7) to evaluate at decode time?
if its improved readability, then suggest renaming 'lf_delta' to 'lf_delta_vp8'
pathces 3-18 look fine to me.
-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [FFmpeg-devel] [PATCH 02/18] avcodec/vp8: Disable lf_delta for VP7
2022-09-11 4:29 ` Peter Ross
@ 2022-09-11 4:38 ` Andreas Rheinhardt
2022-09-11 14:41 ` Ronald S. Bultje
2022-09-11 22:41 ` Peter Ross
0 siblings, 2 replies; 23+ messages in thread
From: Andreas Rheinhardt @ 2022-09-11 4:38 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Peter Ross:
> On Sat, Sep 10, 2022 at 03:07:13AM +0200, Andreas Rheinhardt wrote:
>> It is a VP8-only feature.
>>
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
>> ---
>> libavcodec/vp8.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
>> index c00c5c975e..04a2113cc8 100644
>> --- a/libavcodec/vp8.c
>> +++ b/libavcodec/vp8.c
>> @@ -637,7 +637,6 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
>> for (i = 0; i < 2; i++)
>> memcpy(s->prob->mvc[i], vp7_mv_default_prob[i],
>> sizeof(vp7_mv_default_prob[i]));
>> - memset(&s->lf_delta, 0, sizeof(s->lf_delta));
>> memcpy(s->prob[0].scan, ff_zigzag_scan, sizeof(s->prob[0].scan));
>> }
>>
>> @@ -2171,7 +2170,7 @@ void filter_level_for_mb(VP8Context *s, VP8Macroblock *mb,
>> } else
>> filter_level = s->filter.level;
>>
>> - if (s->lf_delta.enabled) {
>> + if (!is_vp7 && s->lf_delta.enabled) {
>> filter_level += s->lf_delta.ref[mb->ref_frame];
>> filter_level += s->lf_delta.mode[mb->mode];
>> }
>
> what's the motivation for patches 01 and 02?
> are you not just adding another condition (is_vp7) to evaluate at decode time?
> if its improved readability, then suggest renaming 'lf_delta' to 'lf_delta_vp8'
>
> pathces 3-18 look fine to me.
>
is_vp7 is evaluated at compile-time, because all the functions that use
is_vp7 in this decoder are marked as av_always_inline.
If it were otherwise, several of the patches 3-18 would make no sense
and would just add another runtime check.
- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [FFmpeg-devel] [PATCH 02/18] avcodec/vp8: Disable lf_delta for VP7
2022-09-11 4:38 ` Andreas Rheinhardt
@ 2022-09-11 14:41 ` Ronald S. Bultje
2022-09-11 15:09 ` Ronald S. Bultje
2022-09-11 22:41 ` Peter Ross
1 sibling, 1 reply; 23+ messages in thread
From: Ronald S. Bultje @ 2022-09-11 14:41 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Hi,
On Sun, Sep 11, 2022 at 12:38 AM Andreas Rheinhardt <
andreas.rheinhardt@outlook.com> wrote:
> Peter Ross:
> > On Sat, Sep 10, 2022 at 03:07:13AM +0200, Andreas Rheinhardt wrote:
> >> It is a VP8-only feature.
> >>
> >> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> >> ---
> >> libavcodec/vp8.c | 3 +--
> >> 1 file changed, 1 insertion(+), 2 deletions(-)
> >>
> >> diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
> >> index c00c5c975e..04a2113cc8 100644
> >> --- a/libavcodec/vp8.c
> >> +++ b/libavcodec/vp8.c
> >> @@ -637,7 +637,6 @@ static int vp7_decode_frame_header(VP8Context *s,
> const uint8_t *buf, int buf_si
> >> for (i = 0; i < 2; i++)
> >> memcpy(s->prob->mvc[i], vp7_mv_default_prob[i],
> >> sizeof(vp7_mv_default_prob[i]));
> >> - memset(&s->lf_delta, 0, sizeof(s->lf_delta));
> >> memcpy(s->prob[0].scan, ff_zigzag_scan,
> sizeof(s->prob[0].scan));
> >> }
> >>
> >> @@ -2171,7 +2170,7 @@ void filter_level_for_mb(VP8Context *s,
> VP8Macroblock *mb,
> >> } else
> >> filter_level = s->filter.level;
> >>
> >> - if (s->lf_delta.enabled) {
> >> + if (!is_vp7 && s->lf_delta.enabled) {
> >> filter_level += s->lf_delta.ref[mb->ref_frame];
> >> filter_level += s->lf_delta.mode[mb->mode];
> >> }
> >
> > what's the motivation for patches 01 and 02?
> > are you not just adding another condition (is_vp7) to evaluate at decode
> time?
> > if its improved readability, then suggest renaming 'lf_delta' to
> 'lf_delta_vp8'
> >
> > pathces 3-18 look fine to me.
> >
>
> is_vp7 is evaluated at compile-time
>
This should probably be changed to be uppercase then. Lowercase suggests
it's a variable.
Ronald
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [FFmpeg-devel] [PATCH 02/18] avcodec/vp8: Disable lf_delta for VP7
2022-09-11 14:41 ` Ronald S. Bultje
@ 2022-09-11 15:09 ` Ronald S. Bultje
0 siblings, 0 replies; 23+ messages in thread
From: Ronald S. Bultje @ 2022-09-11 15:09 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Hi,
On Sun, Sep 11, 2022 at 10:41 AM Ronald S. Bultje <rsbultje@gmail.com>
wrote:
> Hi,
>
> On Sun, Sep 11, 2022 at 12:38 AM Andreas Rheinhardt <
> andreas.rheinhardt@outlook.com> wrote:
>
>> Peter Ross:
>> > On Sat, Sep 10, 2022 at 03:07:13AM +0200, Andreas Rheinhardt wrote:
>> >> It is a VP8-only feature.
>> >>
>> >> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
>> >> ---
>> >> libavcodec/vp8.c | 3 +--
>> >> 1 file changed, 1 insertion(+), 2 deletions(-)
>> >>
>> >> diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
>> >> index c00c5c975e..04a2113cc8 100644
>> >> --- a/libavcodec/vp8.c
>> >> +++ b/libavcodec/vp8.c
>> >> @@ -637,7 +637,6 @@ static int vp7_decode_frame_header(VP8Context *s,
>> const uint8_t *buf, int buf_si
>> >> for (i = 0; i < 2; i++)
>> >> memcpy(s->prob->mvc[i], vp7_mv_default_prob[i],
>> >> sizeof(vp7_mv_default_prob[i]));
>> >> - memset(&s->lf_delta, 0, sizeof(s->lf_delta));
>> >> memcpy(s->prob[0].scan, ff_zigzag_scan,
>> sizeof(s->prob[0].scan));
>> >> }
>> >>
>> >> @@ -2171,7 +2170,7 @@ void filter_level_for_mb(VP8Context *s,
>> VP8Macroblock *mb,
>> >> } else
>> >> filter_level = s->filter.level;
>> >>
>> >> - if (s->lf_delta.enabled) {
>> >> + if (!is_vp7 && s->lf_delta.enabled) {
>> >> filter_level += s->lf_delta.ref[mb->ref_frame];
>> >> filter_level += s->lf_delta.mode[mb->mode];
>> >> }
>> >
>> > what's the motivation for patches 01 and 02?
>> > are you not just adding another condition (is_vp7) to evaluate at
>> decode time?
>> > if its improved readability, then suggest renaming 'lf_delta' to
>> 'lf_delta_vp8'
>> >
>> > pathces 3-18 look fine to me.
>> >
>>
>> is_vp7 is evaluated at compile-time
>>
>
> This should probably be changed to be uppercase then. Lowercase suggests
> it's a variable.
>
It's inline, not macro, apparently.
I don't like the impact on readability here. Part of me wonders whether it
doesn't make more sense to split this file in vp7.c, vp8.c and vp78.c, and
have a proper design of two decoders and separate/shared parent/child
contexts definitions... A classic FFmpeg dilemma, I guess. The problem is
basically that this complicates people who have to debug this code when
issues occur (me) at the benefit of losing some dead code in vp7. I'm not
super-excited about that...
Ronald
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [FFmpeg-devel] [PATCH 02/18] avcodec/vp8: Disable lf_delta for VP7
2022-09-11 4:38 ` Andreas Rheinhardt
2022-09-11 14:41 ` Ronald S. Bultje
@ 2022-09-11 22:41 ` Peter Ross
1 sibling, 0 replies; 23+ messages in thread
From: Peter Ross @ 2022-09-11 22:41 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1951 bytes --]
On Sun, Sep 11, 2022 at 06:38:39AM +0200, Andreas Rheinhardt wrote:
> Peter Ross:
> > On Sat, Sep 10, 2022 at 03:07:13AM +0200, Andreas Rheinhardt wrote:
> >> It is a VP8-only feature.
> >>
> >> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> >> ---
> >> libavcodec/vp8.c | 3 +--
> >> 1 file changed, 1 insertion(+), 2 deletions(-)
> >>
> >> diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
> >> index c00c5c975e..04a2113cc8 100644
> >> --- a/libavcodec/vp8.c
> >> +++ b/libavcodec/vp8.c
> >> @@ -637,7 +637,6 @@ static int vp7_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
> >> for (i = 0; i < 2; i++)
> >> memcpy(s->prob->mvc[i], vp7_mv_default_prob[i],
> >> sizeof(vp7_mv_default_prob[i]));
> >> - memset(&s->lf_delta, 0, sizeof(s->lf_delta));
> >> memcpy(s->prob[0].scan, ff_zigzag_scan, sizeof(s->prob[0].scan));
> >> }
> >>
> >> @@ -2171,7 +2170,7 @@ void filter_level_for_mb(VP8Context *s, VP8Macroblock *mb,
> >> } else
> >> filter_level = s->filter.level;
> >>
> >> - if (s->lf_delta.enabled) {
> >> + if (!is_vp7 && s->lf_delta.enabled) {
> >> filter_level += s->lf_delta.ref[mb->ref_frame];
> >> filter_level += s->lf_delta.mode[mb->mode];
> >> }
> >
> > what's the motivation for patches 01 and 02?
> > are you not just adding another condition (is_vp7) to evaluate at decode time?
> > if its improved readability, then suggest renaming 'lf_delta' to 'lf_delta_vp8'
> >
> > pathces 3-18 look fine to me.
> >
>
> is_vp7 is evaluated at compile-time, because all the functions that use
> is_vp7 in this decoder are marked as av_always_inline.
> If it were otherwise, several of the patches 3-18 would make no sense
> and would just add another runtime check.
ok make sense
-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2022-09-11 22:42 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-10 0:19 [FFmpeg-devel] [PATCH 01/18] avcodec/vp8: Disable segmentation for VP7 Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 02/18] avcodec/vp8: Disable lf_delta " Andreas Rheinhardt
2022-09-11 4:29 ` Peter Ross
2022-09-11 4:38 ` Andreas Rheinhardt
2022-09-11 14:41 ` Ronald S. Bultje
2022-09-11 15:09 ` Ronald S. Bultje
2022-09-11 22:41 ` Peter Ross
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 03/18] avcodec/vp8: Remove unused macros Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 04/18] avcodec/vp8: Inline mb_layout for VP7 Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 05/18] avcodec/vp8: Inline inner_filter " Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 06/18] avcodec/vp8: Inline mbskip_enabled " Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 07/18] avcodec/vp8: Pass mb_y explicitly Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 08/18] avcodec/vp8: Inline num_coeff_partitions for VP7 Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 09/18] avcodec/vp8: Disable slice-thread synchronization code " Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 10/18] avcodec/vp8: Inline num_jobs " Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 11/18] avcodec/vp8: Inline jobnr, threadnr " Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 12/18] avcodec/vp8: Inline update_last " Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 13/18] avcodec/vp8: Don't use avctx->execute2 " Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 14/18] avcodec/vp8: Move fade_present from context to stack Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 15/18] avcodec/vp8: Disable frame-threading code for VP7 Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 16/18] avcodec/vp8dsp: Remove declarations of inexistent functions Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 17/18] avcodec/vp8dsp: Constify src in vp8_mc_func Andreas Rheinhardt
2022-09-10 1:07 ` [FFmpeg-devel] [PATCH 18/18] avcodec/vp8: Add const where appropriate Andreas Rheinhardt
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git