summaryrefslogtreecommitdiffstats
path: root/libmpdemux/mpeg_hdr.c
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-05-07 16:05:38 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-05-07 16:05:38 +0000
commit56286b38d42575595f821fcedb07c65a2c5304b4 (patch)
tree0e0cf544ab17c885f3e84eaeb42e07f0832d5559 /libmpdemux/mpeg_hdr.c
parent92b6f792d95f971d9c32c5dbbfaaf425faf756ec (diff)
downloadmpv-56286b38d42575595f821fcedb07c65a2c5304b4.tar.bz2
mpv-56286b38d42575595f821fcedb07c65a2c5304b4.tar.xz
COSMETICS: moved code to parse mpeg1/2 A/R to mpeg_hdr.c
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18399 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/mpeg_hdr.c')
-rw-r--r--libmpdemux/mpeg_hdr.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/libmpdemux/mpeg_hdr.c b/libmpdemux/mpeg_hdr.c
index 4ab8fea45d..e2d0ecaa23 100644
--- a/libmpdemux/mpeg_hdr.c
+++ b/libmpdemux/mpeg_hdr.c
@@ -8,6 +8,8 @@
#include "config.h"
#include "mpeg_hdr.h"
+#include "mp_msg.h"
+
static float frameratecode2framerate[16] = {
0,
// Official mpeg1/2 framerates: (1-8)
@@ -102,6 +104,37 @@ int mp_header_process_extension (mp_mpeg_header_t * picture, unsigned char * buf
return 0;
}
+float mpeg12_aspect_info(mp_mpeg_header_t *picture)
+{
+ float aspect = 0.0;
+
+ switch(picture->aspect_ratio_information) {
+ case 2: // PAL/NTSC SVCD/DVD 4:3
+ case 8: // PAL VCD 4:3
+ case 12: // NTSC VCD 4:3
+ aspect=4.0/3.0;
+ break;
+ case 3: // PAL/NTSC Widescreen SVCD/DVD 16:9
+ case 6: // (PAL?)/NTSC Widescreen SVCD 16:9
+ aspect=16.0/9.0;
+ break;
+ case 4: // according to ISO-138182-2 Table 6.3
+ aspect=2.21;
+ break;
+ case 1: // VGA 1:1 - do not prescale
+ case 9: // Movie Type ??? / 640x480
+ aspect=0.0;
+ break;
+ default:
+ mp_msg(MSGT_DECVIDEO,MSGL_ERR,"Detected unknown aspect_ratio_information in mpeg sequence header.\n"
+ "Please report the aspect value (%i) along with the movie type (VGA,PAL,NTSC,"
+ "SECAM) and the movie resolution (720x576,352x240,480x480,...) to the MPlayer"
+ " developers, so that we can add support for it!\nAssuming 1:1 aspect for now.\n",
+ picture->aspect_ratio_information);
+ }
+
+ return aspect;
+}
//MPEG4 HEADERS
unsigned char mp_getbits(unsigned char *buffer, unsigned int from, unsigned char len)