[AG-TECH] Compiling VIC from source to enable High-res streams

S.Booth spb at epcc.ed.ac.uk
Thu Feb 20 09:34:41 CST 2003


I have been trying to modify the ag-vic source from
  :pserver:anonymous at fl-cvs.mcs.anl.gov:/cvsroot/ag-vic 
to enable higher res video streams using the h263+ codec.
(My current version of a patch to do this is attached)
In the original code there were various statically sized buffers that were
only large enough for normal image sizes.
 It seems to work up to a point (for some reason the thumbnails don't work
when sending a large image size stream but this seems to be a
generic problem as the same happens with the bvc codec as well.

However the main problem is that vic runs VERY VERY slowly compared with
the normal ag vic (vic-2001-0601) and the h.261 codec seems broken!
Are there some debug flags I should be turning off or is this a problem
with the compiler version I'm using?
I'm using
	gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)

		Stephen




======================================================================
|epcc| Dr Stephen P Booth             Project Manager           |epcc|
|epcc| s.booth at epcc.ed.ac.uk          Phone 0131 650 5746       |epcc|
======================================================================
-------------- next part --------------
Index: codec/decoder-h263v2.cpp
===================================================================
RCS file: /cvsroot/ag-vic/vic/codec/decoder-h263v2.cpp,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 decoder-h263v2.cpp
3a4
> #include <assert.h>
10c11,12
< 
---
> #define FRAMESIZE 1600000
> #define BITSSSIZE 65536
30c32,33
<     char       bitstream[65536];   /* bitstream data */
---
>     char       *bitstream;   /* bitstream data */
>     int        bsize;
37c40
<     u_char     xxx_frame[160000];
---
>     u_char     xxx_frame[FRAMESIZE];
78a82,83
> 	bitstream = (char *) 0;
> 	bsize = 0;
87a93,96
> 	if( bitstream ){
> 	  free(bitstream);
> 	   bitstream = (char *) 0;
>         }
152a162
> 
159a170,177
>     if( bsize == 0 ){
>       bitstream = (char *) malloc(BITSSSIZE);
>       if( ! bitstream ){
>         perror("malloc failed");
> 	exit(1);
>       }
>       bsize=BITSSSIZE;
>     }
187a206,218
>                 /* grow buffer */
> 		if(b_off+(cc-bs) > bsize){
> 		   while(b_off+(cc-bs) > bsize){
> 		      bsize *=2; 
>                    }
> 		   fprintf(stderr,"realloc bitstream %d\n",bsize);
> 		   bitstream = (char *) realloc(bitstream,bsize);
> 		   if( ! bitstream ){
> 		     perror("realloc failed");
> 		     exit(1);
>                    }
>                 }
>                 
198a230,241
>                 /* grow buffer */
> 		if(b_off+3 > bsize){
> 		   while(b_off+3 > bsize){
> 		      bsize *=2; 
>                    }
> 		   fprintf(stderr,"realloc bitstream %d\n",bsize);
> 		   bitstream = (char *) realloc(bitstream,bsize);
> 		   if( ! bitstream ){
> 		     perror("realloc failed");
> 		     exit(1);
>                    }
>                 }
211a255
>  		        assert(size <= FRAMESIZE);
212a257
>  		        assert(size + size/4 <= FRAMESIZE);
213a259
>  		        assert(size*5/4 + size/4 <= FRAMESIZE);
Index: codec/encoder-h263v2.cpp
===================================================================
RCS file: /cvsroot/ag-vic/vic/codec/encoder-h263v2.cpp,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 encoder-h263v2.cpp
40a41
> #include <assert.h>
59a61,66
> #define	CIF4_WIDTH	704
> #define	CIF4_HEIGHT	576
> #define	CIF16_WIDTH	1408
> #define	CIF16_HEIGHT	1152
> 
> 
69a77
> extern "C" int          h263_bitstream_size;
125a134
> /* These seem to be values CIF/CIF4 etc from tmn/sim.h */
129a139,142
>     } else if (w == CIF4_WIDTH && h == CIF4_HEIGHT) {
> 		state->pic->source_format = 4;
>     } else if (w == CIF16_WIDTH && h == CIF16_HEIGHT) {
> 		state->pic->source_format = 5;
185a199,200
> 		h263_bitstream=(char *) 0;
>                 h263_bitstream_size = 0;
192a208
> 		h263_bitstream_size = 65536;
231a248,249
>                 assert(ps + 14 <= RTP_MTU);
>                 assert(ps+n <= h263_bitstream_size);
Index: codec/tmn/putbits.c
===================================================================
RCS file: /cvsroot/ag-vic/vic/codec/tmn/putbits.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 putbits.c
69c69,70
< unsigned char *h263_bitstream;
---
> unsigned char *h263_bitstream=(char *) 0;
> int h263_bitstream_size=0;
118a120,123
>       if( h263_streamcount >= h263_bitstream_size ){
>         h263_bitstream_size *= 2;
>         h263_bitstream = (char *) realloc(h263_bitstream,h263_bitstream_size);
>       }
Index: codec/tmn-x/putbits.c
===================================================================
RCS file: /cvsroot/ag-vic/vic/codec/tmn-x/putbits.c,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 putbits.c
69c69,70
< unsigned char *h263_bitstream;
---
> unsigned char *h263_bitstream=(char *) 0;
> int h263_bitstream_size=0;
118a120,124
>       if( h263_streamcount >= h263_bitstream_size ){
>         h263_bitstream_size *= 2;
>         h263_bitstream = (char *) realloc(h263_bitstream,h263_bitstream_size);
> 	fprintf(stderr,"realloc to %d\n",h263_bitstream_size);
>       }
Index: tcl/cf-util.tcl
===================================================================
RCS file: /cvsroot/ag-vic/vic/tcl/cf-util.tcl,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 cf-util.tcl
195c195
< 	puts "resrouce $r $V(class)"
---
> 	# puts "resrouce $r $V(class)"


More information about the ag-tech mailing list