comparison libmpdemux/mpeg_hdr.c @ 15073:28ba6bfcf2dc

assign picture->(width,height) when parsing h264
author nicodvb
date Sat, 09 Apr 2005 11:00:00 +0000
parents d901658f487d
children d49091f2206c
comparison
equal deleted inserted replaced
15072:9ec12f960724 15073:28ba6bfcf2dc
295 return n; 295 return n;
296 } 296 }
297 297
298 int h264_parse_sps(mp_mpeg_header_t * picture, unsigned char * buf, int len) 298 int h264_parse_sps(mp_mpeg_header_t * picture, unsigned char * buf, int len)
299 { 299 {
300 unsigned int n = 0, m = 0, v, i, j; 300 unsigned int n = 0, v, i, j, mbh;
301 unsigned char *dest; 301 unsigned char *dest;
302 int frame_mbs_only;
302 303
303 dest = (unsigned char*) malloc(len); 304 dest = (unsigned char*) malloc(len);
304 if(! dest) 305 if(! dest)
305 return 0; 306 return 0;
306 j = i = 0; 307 j = i = 0;
341 for(i = 0; i < v; i++) 342 for(i = 0; i < v; i++)
342 read_golomb(buf, &n); 343 read_golomb(buf, &n);
343 } 344 }
344 read_golomb(buf, &n); 345 read_golomb(buf, &n);
345 getbits(buf, n++, 1); 346 getbits(buf, n++, 1);
346 read_golomb(buf, &n); 347 picture->display_picture_width = 16 *(read_golomb(buf, &n)+1);
347 read_golomb(buf, &n); 348 mbh = read_golomb(buf, &n)+1;
348 if(!getbits(buf, n++, 1)) 349 frame_mbs_only = getbits(buf, n++, 1);
350 picture->display_picture_height = 16 * (2 - frame_mbs_only) * mbh;
351 if(!frame_mbs_only)
349 getbits(buf, n++, 1); 352 getbits(buf, n++, 1);
350 getbits(buf, n++, 1); 353 getbits(buf, n++, 1);
351 if(getbits(buf, n++, 1)) 354 if(getbits(buf, n++, 1))
352 { 355 {
353 read_golomb(buf, &n); 356 read_golomb(buf, &n);