Re: [FFmpeg-devel] [PATCH 34/39] avcodec/mpegvideoencdsp: Allow pointers to const where possible

2022-08-03 Thread Michael Niedermayer
On Wed, Aug 03, 2022 at 05:28:16PM +0200, Michael Niedermayer wrote:
> On Tue, Aug 02, 2022 at 11:30:39AM +0200, Anton Khirnov wrote:
> > Quoting Michael Niedermayer (2022-07-30 19:12:39)
> > > On Sat, Jul 30, 2022 at 11:55:45AM +0200, Andreas Rheinhardt wrote:
> > > > Michael Niedermayer:
> > > > > On Wed, Jul 27, 2022 at 12:08:09AM +0200, Andreas Rheinhardt wrote:
> > > > >> Signed-off-by: Andreas Rheinhardt 
> > > > >> ---
> > > > >>  libavcodec/arm/mpegvideoencdsp_init_arm.c  |  4 ++--
> > > > >>  libavcodec/mips/h263dsp_mips.h |  2 +-
> > > > >>  libavcodec/mips/mpegvideoencdsp_msa.c  |  4 ++--
> > > > >>  libavcodec/mpegvideoencdsp.c   | 10 +-
> > > > >>  libavcodec/mpegvideoencdsp.h   | 10 +-
> > > > >>  libavcodec/ppc/mpegvideoencdsp.c   |  8 
> > > > >>  libavcodec/x86/mpegvideoenc_qns_template.c |  4 ++--
> > > > >>  libavcodec/x86/mpegvideoencdsp.asm |  4 ++--
> > > > >>  libavcodec/x86/mpegvideoencdsp_init.c  |  6 +++---
> > > > >>  9 files changed, 26 insertions(+), 26 deletions(-)
> > > > > 
> > > > > LGTM, also all similar things should be ok
> > > > > 
> > > > > [...]
> > > > > 
> > > > 
> > > > Unfortunately, it is not so easy. The first version of this patchset
> > > > (this here) forgot to update the definitions of several loongarch
> > > > functions, leading to lots of red on patchwork. The second version fixed
> > > > the compilation error, but forgot some constifications due to
> > > > unfortunate oversights. For the third version, I wanted to actually
> > > > compile loongarch instead of just staring at the code; but the
> > > > GCC-cross-compiler does not seem to support lsx and lasx (and looking at
> > > > the loongarch-code in GCC makes me believe that they are just not
> > > > supported (yet)). Therefore I resorted to creating dummy-functions for
> > > > all the __lasx_* and __lsx_* functions (they show no more
> > > > const-warnings). I wanted to let the FATE-loongarch-box test this once
> > > > more (and tell me whether there are still any issues left), yet this box
> > > > is no longer active since a few days (for reasons unknown). Can you
> > > > compile the lsx and lasx code (after all, you committed all the
> > > > loongarch code)?
> > > 
> > > i have no easy way to test loongarch, what i can test is qemu-mips.
> > > i think i have said that a few times already.
> > > 
> > > I do have a loongson box that is IIRC ready to be shipped (within EU) to
> > > whoever volunteers to maintain that box for FFmpeg. I dont know if that
> > > box would help with the current code. The OS will liklely need to be 
> > > updated
> > > and IIRC this has no normal update mechanism) I didnt touch this box for a
> > > really long time.
> > 
> > What OS is it?
> 
> looking thorugh past emails (so i dont have to get the box and unpack it 
> again)
> 
> its some custom fedora/redhat
> that additional info i found while double checking the OS:
> 
>  according to /proc/cpuinfo, 4 core
>  system type : lst-loongson3-eva
>  machine : Unknown
>  processor   : 0
>  cpu model   : ICT Loongson-3A V0.5  FPU V0.1
>  BogoMIPS    : 717.28
>  ...
>  with 500gb 7200rpm WD Caviar Blue HDD
>  4gb memory
> 
> 
> > 
> > I could conceivably host such a machine and give other devs SSH access
> > to it, if it does not require too much maintenance and/or electricity.
> 
> given the tiny heatsink/fan on the CPU i dont think it would require alot of 
> power
> send me teh target address and ill get it shipped to you assuming the box is 
> still where
> it was and i find it

more precisse power usage: (from 2015)

~1W when OFF
~44W when IDLE
~48W when running fate tests

in 2015 with FFmpeg from 2015:

4m49.192s for time ./configure --enable-gpl --enable-pthreads 
--samples=/home/loongson/fate/ --enable-nonfree --enable-version3 
--assert-level=2 --cpu=loongson3a --enable-loongson3
19m31.114s for make -j4

time make fate -j4 -k >& fatelist8
real 28m32.631s
user 98m50.422s
sys 12m53.547s

CPU coolong fan was also replaced with a Noctua NF-A6x25 FLX as the original 
was really loud

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Elect your leaders based on what they did after the last election, not
based on what they say before an election.



signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 34/39] avcodec/mpegvideoencdsp: Allow pointers to const where possible

2022-08-03 Thread Michael Niedermayer
On Tue, Aug 02, 2022 at 11:30:39AM +0200, Anton Khirnov wrote:
> Quoting Michael Niedermayer (2022-07-30 19:12:39)
> > On Sat, Jul 30, 2022 at 11:55:45AM +0200, Andreas Rheinhardt wrote:
> > > Michael Niedermayer:
> > > > On Wed, Jul 27, 2022 at 12:08:09AM +0200, Andreas Rheinhardt wrote:
> > > >> Signed-off-by: Andreas Rheinhardt 
> > > >> ---
> > > >>  libavcodec/arm/mpegvideoencdsp_init_arm.c  |  4 ++--
> > > >>  libavcodec/mips/h263dsp_mips.h |  2 +-
> > > >>  libavcodec/mips/mpegvideoencdsp_msa.c  |  4 ++--
> > > >>  libavcodec/mpegvideoencdsp.c   | 10 +-
> > > >>  libavcodec/mpegvideoencdsp.h   | 10 +-
> > > >>  libavcodec/ppc/mpegvideoencdsp.c   |  8 
> > > >>  libavcodec/x86/mpegvideoenc_qns_template.c |  4 ++--
> > > >>  libavcodec/x86/mpegvideoencdsp.asm |  4 ++--
> > > >>  libavcodec/x86/mpegvideoencdsp_init.c  |  6 +++---
> > > >>  9 files changed, 26 insertions(+), 26 deletions(-)
> > > > 
> > > > LGTM, also all similar things should be ok
> > > > 
> > > > [...]
> > > > 
> > > 
> > > Unfortunately, it is not so easy. The first version of this patchset
> > > (this here) forgot to update the definitions of several loongarch
> > > functions, leading to lots of red on patchwork. The second version fixed
> > > the compilation error, but forgot some constifications due to
> > > unfortunate oversights. For the third version, I wanted to actually
> > > compile loongarch instead of just staring at the code; but the
> > > GCC-cross-compiler does not seem to support lsx and lasx (and looking at
> > > the loongarch-code in GCC makes me believe that they are just not
> > > supported (yet)). Therefore I resorted to creating dummy-functions for
> > > all the __lasx_* and __lsx_* functions (they show no more
> > > const-warnings). I wanted to let the FATE-loongarch-box test this once
> > > more (and tell me whether there are still any issues left), yet this box
> > > is no longer active since a few days (for reasons unknown). Can you
> > > compile the lsx and lasx code (after all, you committed all the
> > > loongarch code)?
> > 
> > i have no easy way to test loongarch, what i can test is qemu-mips.
> > i think i have said that a few times already.
> > 
> > I do have a loongson box that is IIRC ready to be shipped (within EU) to
> > whoever volunteers to maintain that box for FFmpeg. I dont know if that
> > box would help with the current code. The OS will liklely need to be updated
> > and IIRC this has no normal update mechanism) I didnt touch this box for a
> > really long time.
> 
> What OS is it?

looking thorugh past emails (so i dont have to get the box and unpack it again)

its some custom fedora/redhat
that additional info i found while double checking the OS:

 according to /proc/cpuinfo, 4 core
 system type : lst-loongson3-eva
 machine : Unknown
 processor   : 0
 cpu model   : ICT Loongson-3A V0.5  FPU V0.1
 BogoMIPS    : 717.28
 ...
 with 500gb 7200rpm WD Caviar Blue HDD
 4gb memory


> 
> I could conceivably host such a machine and give other devs SSH access
> to it, if it does not require too much maintenance and/or electricity.

given the tiny heatsink/fan on the CPU i dont think it would require alot of 
power
send me teh target address and ill get it shipped to you assuming the box is 
still where
it was and i find it

thx


[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 34/39] avcodec/mpegvideoencdsp: Allow pointers to const where possible

2022-08-02 Thread Anton Khirnov
Quoting Michael Niedermayer (2022-07-30 19:12:39)
> On Sat, Jul 30, 2022 at 11:55:45AM +0200, Andreas Rheinhardt wrote:
> > Michael Niedermayer:
> > > On Wed, Jul 27, 2022 at 12:08:09AM +0200, Andreas Rheinhardt wrote:
> > >> Signed-off-by: Andreas Rheinhardt 
> > >> ---
> > >>  libavcodec/arm/mpegvideoencdsp_init_arm.c  |  4 ++--
> > >>  libavcodec/mips/h263dsp_mips.h |  2 +-
> > >>  libavcodec/mips/mpegvideoencdsp_msa.c  |  4 ++--
> > >>  libavcodec/mpegvideoencdsp.c   | 10 +-
> > >>  libavcodec/mpegvideoencdsp.h   | 10 +-
> > >>  libavcodec/ppc/mpegvideoencdsp.c   |  8 
> > >>  libavcodec/x86/mpegvideoenc_qns_template.c |  4 ++--
> > >>  libavcodec/x86/mpegvideoencdsp.asm |  4 ++--
> > >>  libavcodec/x86/mpegvideoencdsp_init.c  |  6 +++---
> > >>  9 files changed, 26 insertions(+), 26 deletions(-)
> > > 
> > > LGTM, also all similar things should be ok
> > > 
> > > [...]
> > > 
> > 
> > Unfortunately, it is not so easy. The first version of this patchset
> > (this here) forgot to update the definitions of several loongarch
> > functions, leading to lots of red on patchwork. The second version fixed
> > the compilation error, but forgot some constifications due to
> > unfortunate oversights. For the third version, I wanted to actually
> > compile loongarch instead of just staring at the code; but the
> > GCC-cross-compiler does not seem to support lsx and lasx (and looking at
> > the loongarch-code in GCC makes me believe that they are just not
> > supported (yet)). Therefore I resorted to creating dummy-functions for
> > all the __lasx_* and __lsx_* functions (they show no more
> > const-warnings). I wanted to let the FATE-loongarch-box test this once
> > more (and tell me whether there are still any issues left), yet this box
> > is no longer active since a few days (for reasons unknown). Can you
> > compile the lsx and lasx code (after all, you committed all the
> > loongarch code)?
> 
> i have no easy way to test loongarch, what i can test is qemu-mips.
> i think i have said that a few times already.
> 
> I do have a loongson box that is IIRC ready to be shipped (within EU) to
> whoever volunteers to maintain that box for FFmpeg. I dont know if that
> box would help with the current code. The OS will liklely need to be updated
> and IIRC this has no normal update mechanism) I didnt touch this box for a
> really long time.

What OS is it?

I could conceivably host such a machine and give other devs SSH access
to it, if it does not require too much maintenance and/or electricity.

-- 
Anton Khirnov
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 34/39] avcodec/mpegvideoencdsp: Allow pointers to const where possible

2022-07-30 Thread Michael Niedermayer
On Sat, Jul 30, 2022 at 11:55:45AM +0200, Andreas Rheinhardt wrote:
> Michael Niedermayer:
> > On Wed, Jul 27, 2022 at 12:08:09AM +0200, Andreas Rheinhardt wrote:
> >> Signed-off-by: Andreas Rheinhardt 
> >> ---
> >>  libavcodec/arm/mpegvideoencdsp_init_arm.c  |  4 ++--
> >>  libavcodec/mips/h263dsp_mips.h |  2 +-
> >>  libavcodec/mips/mpegvideoencdsp_msa.c  |  4 ++--
> >>  libavcodec/mpegvideoencdsp.c   | 10 +-
> >>  libavcodec/mpegvideoencdsp.h   | 10 +-
> >>  libavcodec/ppc/mpegvideoencdsp.c   |  8 
> >>  libavcodec/x86/mpegvideoenc_qns_template.c |  4 ++--
> >>  libavcodec/x86/mpegvideoencdsp.asm |  4 ++--
> >>  libavcodec/x86/mpegvideoencdsp_init.c  |  6 +++---
> >>  9 files changed, 26 insertions(+), 26 deletions(-)
> > 
> > LGTM, also all similar things should be ok
> > 
> > [...]
> > 
> 
> Unfortunately, it is not so easy. The first version of this patchset
> (this here) forgot to update the definitions of several loongarch
> functions, leading to lots of red on patchwork. The second version fixed
> the compilation error, but forgot some constifications due to
> unfortunate oversights. For the third version, I wanted to actually
> compile loongarch instead of just staring at the code; but the
> GCC-cross-compiler does not seem to support lsx and lasx (and looking at
> the loongarch-code in GCC makes me believe that they are just not
> supported (yet)). Therefore I resorted to creating dummy-functions for
> all the __lasx_* and __lsx_* functions (they show no more
> const-warnings). I wanted to let the FATE-loongarch-box test this once
> more (and tell me whether there are still any issues left), yet this box
> is no longer active since a few days (for reasons unknown). Can you
> compile the lsx and lasx code (after all, you committed all the
> loongarch code)?

i have no easy way to test loongarch, what i can test is qemu-mips.
i think i have said that a few times already.

I do have a loongson box that is IIRC ready to be shipped (within EU) to
whoever volunteers to maintain that box for FFmpeg. I dont know if that
box would help with the current code. The OS will liklely need to be updated
and IIRC this has no normal update mechanism) I didnt touch this box for a
really long time.

I apply loongarch patches when they are reviewed and approved by the loongson
maintainers.
I do test that they do not break qemu-mips and give them a quick look also
so they dont contains obvious mistakes like changing non mips things

about patchwork, please talk with Andriy.
If you want to help maintain patchwork and or look into that yourself,
again talk with Andriy.
Also paul on IRC said Andriy left ffmpeg, i havent heared anything from
Andriy in that direction. So this may be a joke from paul i do not know

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 34/39] avcodec/mpegvideoencdsp: Allow pointers to const where possible

2022-07-30 Thread Andreas Rheinhardt
Michael Niedermayer:
> On Wed, Jul 27, 2022 at 12:08:09AM +0200, Andreas Rheinhardt wrote:
>> Signed-off-by: Andreas Rheinhardt 
>> ---
>>  libavcodec/arm/mpegvideoencdsp_init_arm.c  |  4 ++--
>>  libavcodec/mips/h263dsp_mips.h |  2 +-
>>  libavcodec/mips/mpegvideoencdsp_msa.c  |  4 ++--
>>  libavcodec/mpegvideoencdsp.c   | 10 +-
>>  libavcodec/mpegvideoencdsp.h   | 10 +-
>>  libavcodec/ppc/mpegvideoencdsp.c   |  8 
>>  libavcodec/x86/mpegvideoenc_qns_template.c |  4 ++--
>>  libavcodec/x86/mpegvideoencdsp.asm |  4 ++--
>>  libavcodec/x86/mpegvideoencdsp_init.c  |  6 +++---
>>  9 files changed, 26 insertions(+), 26 deletions(-)
> 
> LGTM, also all similar things should be ok
> 
> [...]
> 

Unfortunately, it is not so easy. The first version of this patchset
(this here) forgot to update the definitions of several loongarch
functions, leading to lots of red on patchwork. The second version fixed
the compilation error, but forgot some constifications due to
unfortunate oversights. For the third version, I wanted to actually
compile loongarch instead of just staring at the code; but the
GCC-cross-compiler does not seem to support lsx and lasx (and looking at
the loongarch-code in GCC makes me believe that they are just not
supported (yet)). Therefore I resorted to creating dummy-functions for
all the __lasx_* and __lsx_* functions (they show no more
const-warnings). I wanted to let the FATE-loongarch-box test this once
more (and tell me whether there are still any issues left), yet this box
is no longer active since a few days (for reasons unknown). Can you
compile the lsx and lasx code (after all, you committed all the
loongarch code)?

- 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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 34/39] avcodec/mpegvideoencdsp: Allow pointers to const where possible

2022-07-28 Thread Michael Niedermayer
On Wed, Jul 27, 2022 at 12:08:09AM +0200, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/arm/mpegvideoencdsp_init_arm.c  |  4 ++--
>  libavcodec/mips/h263dsp_mips.h |  2 +-
>  libavcodec/mips/mpegvideoencdsp_msa.c  |  4 ++--
>  libavcodec/mpegvideoencdsp.c   | 10 +-
>  libavcodec/mpegvideoencdsp.h   | 10 +-
>  libavcodec/ppc/mpegvideoencdsp.c   |  8 
>  libavcodec/x86/mpegvideoenc_qns_template.c |  4 ++--
>  libavcodec/x86/mpegvideoencdsp.asm |  4 ++--
>  libavcodec/x86/mpegvideoencdsp_init.c  |  6 +++---
>  9 files changed, 26 insertions(+), 26 deletions(-)

LGTM, also all similar things should be ok

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Any man who breaks a law that conscience tells him is unjust and willingly 
accepts the penalty by staying in jail in order to arouse the conscience of 
the community on the injustice of the law is at that moment expressing the 
very highest respect for law. - Martin Luther King Jr


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 34/39] avcodec/mpegvideoencdsp: Allow pointers to const where possible

2022-07-27 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/arm/mpegvideoencdsp_init_arm.c  |  4 ++--
 libavcodec/mips/h263dsp_mips.h |  2 +-
 libavcodec/mips/mpegvideoencdsp_msa.c  |  4 ++--
 libavcodec/mpegvideoencdsp.c   | 10 +-
 libavcodec/mpegvideoencdsp.h   | 10 +-
 libavcodec/ppc/mpegvideoencdsp.c   |  8 
 libavcodec/x86/mpegvideoenc_qns_template.c |  4 ++--
 libavcodec/x86/mpegvideoencdsp.asm |  4 ++--
 libavcodec/x86/mpegvideoencdsp_init.c  |  6 +++---
 9 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/libavcodec/arm/mpegvideoencdsp_init_arm.c 
b/libavcodec/arm/mpegvideoencdsp_init_arm.c
index 31d1474416..a95b5bebe9 100644
--- a/libavcodec/arm/mpegvideoencdsp_init_arm.c
+++ b/libavcodec/arm/mpegvideoencdsp_init_arm.c
@@ -24,8 +24,8 @@
 #include "libavcodec/avcodec.h"
 #include "libavcodec/mpegvideoencdsp.h"
 
-int ff_pix_norm1_armv6(uint8_t *pix, int line_size);
-int ff_pix_sum_armv6(uint8_t *pix, int line_size);
+int ff_pix_norm1_armv6(const uint8_t *pix, int line_size);
+int ff_pix_sum_armv6(const uint8_t *pix, int line_size);
 
 av_cold void ff_mpegvideoencdsp_init_arm(MpegvideoEncDSPContext *c,
  AVCodecContext *avctx)
diff --git a/libavcodec/mips/h263dsp_mips.h b/libavcodec/mips/h263dsp_mips.h
index 99a43cd44a..f225ee563e 100644
--- a/libavcodec/mips/h263dsp_mips.h
+++ b/libavcodec/mips/h263dsp_mips.h
@@ -31,6 +31,6 @@ void ff_dct_unquantize_h263_inter_msa(MpegEncContext *s, 
int16_t *block,
   int32_t index, int32_t q_scale);
 void ff_dct_unquantize_h263_intra_msa(MpegEncContext *s, int16_t *block,
   int32_t index, int32_t q_scale);
-int ff_pix_sum_msa(uint8_t *pix, int line_size);
+int ff_pix_sum_msa(const uint8_t *pix, int line_size);
 
 #endif  // #ifndef AVCODEC_MIPS_H263DSP_MIPS_H
diff --git a/libavcodec/mips/mpegvideoencdsp_msa.c 
b/libavcodec/mips/mpegvideoencdsp_msa.c
index 46473dafe5..9043730cd7 100644
--- a/libavcodec/mips/mpegvideoencdsp_msa.c
+++ b/libavcodec/mips/mpegvideoencdsp_msa.c
@@ -21,7 +21,7 @@
 #include "h263dsp_mips.h"
 #include "libavutil/mips/generic_macros_msa.h"
 
-static int32_t sum_u8src_16width_msa(uint8_t *src, int32_t stride)
+static int32_t sum_u8src_16width_msa(const uint8_t *src, int32_t stride)
 {
 uint32_t sum = 0;
 v16u8 in0, in1, in2, in3, in4, in5, in6, in7;
@@ -56,7 +56,7 @@ static int32_t sum_u8src_16width_msa(uint8_t *src, int32_t 
stride)
 return sum;
 }
 
-int ff_pix_sum_msa(uint8_t *pix, int line_size)
+int ff_pix_sum_msa(const uint8_t *pix, int line_size)
 {
 return sum_u8src_16width_msa(pix, line_size);
 }
diff --git a/libavcodec/mpegvideoencdsp.c b/libavcodec/mpegvideoencdsp.c
index adf19e69f4..997d048663 100644
--- a/libavcodec/mpegvideoencdsp.c
+++ b/libavcodec/mpegvideoencdsp.c
@@ -28,8 +28,8 @@
 #include "me_cmp.h"
 #include "mpegvideoencdsp.h"
 
-static int try_8x8basis_c(int16_t rem[64], int16_t weight[64],
-  int16_t basis[64], int scale)
+static int try_8x8basis_c(const int16_t rem[64], const int16_t weight[64],
+  const int16_t basis[64], int scale)
 {
 int i;
 unsigned int sum = 0;
@@ -47,7 +47,7 @@ static int try_8x8basis_c(int16_t rem[64], int16_t weight[64],
 return sum >> 2;
 }
 
-static void add_8x8basis_c(int16_t rem[64], int16_t basis[64], int scale)
+static void add_8x8basis_c(int16_t rem[64], const int16_t basis[64], int scale)
 {
 int i;
 
@@ -57,7 +57,7 @@ static void add_8x8basis_c(int16_t rem[64], int16_t 
basis[64], int scale)
   (BASIS_SHIFT - RECON_SHIFT);
 }
 
-static int pix_sum_c(uint8_t *pix, int line_size)
+static int pix_sum_c(const uint8_t *pix, int line_size)
 {
 int s = 0, i, j;
 
@@ -78,7 +78,7 @@ static int pix_sum_c(uint8_t *pix, int line_size)
 return s;
 }
 
-static int pix_norm1_c(uint8_t *pix, int line_size)
+static int pix_norm1_c(const uint8_t *pix, int line_size)
 {
 int s = 0, i, j;
 const uint32_t *sq = ff_square_tab + 256;
diff --git a/libavcodec/mpegvideoencdsp.h b/libavcodec/mpegvideoencdsp.h
index 33f0282fcc..95084679d9 100644
--- a/libavcodec/mpegvideoencdsp.h
+++ b/libavcodec/mpegvideoencdsp.h
@@ -30,12 +30,12 @@
 #define EDGE_BOTTOM 2
 
 typedef struct MpegvideoEncDSPContext {
-int (*try_8x8basis)(int16_t rem[64], int16_t weight[64],
-int16_t basis[64], int scale);
-void (*add_8x8basis)(int16_t rem[64], int16_t basis[64], int scale);
+int (*try_8x8basis)(const int16_t rem[64], const int16_t weight[64],
+const int16_t basis[64], int scale);
+void (*add_8x8basis)(int16_t rem[64], const int16_t basis[64], int scale);
 
-int (*pix_sum)(uint8_t *pix, int line_size);
-int (*pix_norm1)(uint8_t *pix, int line_size);
+int (*pix_sum)(const uint8_t *pix, int line_size);
+int (*pix_norm1)(const uint8_t *pix, int