[Ffmpeg-devel] GCC4 fix

Keenan Pepper keenanpepper
Wed May 4 06:23:38 CEST 2005


Hello, ffmpeg-devel!

GCC4 errors out on libavcodec/libpostproc/postprocess_template.c with 
"error: memory input 4 is not directly addressable". I think the problem 
is that the input to the asm block can't just be any expression, it has 
to be a real variable with an lvalue.

I don't know much about gcc inline assembly, so this might not be the 
best fix, but it compiles and runs for me:

--- postprocess_template.orig.c	2005-05-04 00:13:55.809595776 -0400
+++ postprocess_template.c	2005-05-04 00:17:44.090891744 -0400
@@ -2646,7 +2646,7 @@
   * accurate deblock filter
   */
  static always_inline void RENAME(do_a_deblock)(uint8_t *src, int step, 
int stri 
                        de, PPContext *c){
-	int64_t dc_mask, eq_mask;
+	int64_t dc_mask, eq_mask, both_masks;
  	int64_t sums[10*8*2];
  	src+= step*3; // src points to begin of the 8x8 Block
  //START_TIMER
@@ -2755,7 +2755,9 @@
  		: "%"REG_a
  		);

-	if(dc_mask & eq_mask){
+	both_masks = dc_mask & eq_mask;
+
+	if(both_masks){
  		long offset= -8*step;
  		int64_t *temp_sums= sums;

@@ -2930,7 +2932,7 @@
  		" js 1b						\n\t"

  		: "+r"(offset), "+r"(temp_sums)
-		: "r" ((long)step), "r"(src - offset), "m"(dc_mask & eq_mask)
+		: "r" ((long)step), "r"(src - offset), "m"(both_masks)
  		);
  	}else
  		src+= step; // src points to begin of the 8x8 Block





More information about the ffmpeg-devel mailing list