r885: Don't delete a borrowed frame.
[cinelerra_cv/ct.git] / mpeg2enc / conform.c
blobb67242560c8af12255a4de0bb07d59f0004cbee2
1 /* conform.c, conformance checks */
3 /* Copyright (C) 1996, MPEG Software Simulation Group. All Rights Reserved. */
5 /*
6 * Disclaimer of Warranty
8 * These software programs are available to the user without any license fee or
9 * royalty on an "as is" basis. The MPEG Software Simulation Group disclaims
10 * any and all warranties, whether express, implied, or statuary, including any
11 * implied warranties or merchantability or of fitness for a particular
12 * purpose. In no event shall the copyright-holder be liable for any
13 * incidental, punitive, or consequential damages of any kind whatsoever
14 * arising from the use of these programs.
16 * This disclaimer of warranty extends to the user of these programs and user's
17 * customers, employees, agents, transferees, successors, and assigns.
19 * The MPEG Software Simulation Group does not represent or warrant that the
20 * programs furnished hereunder are free of infringement of any third-party
21 * patents.
23 * Commercial implementations of MPEG-1 and MPEG-2 video, including shareware,
24 * are subject to royalty fees to patent holders. Many of these patents are
25 * general enough such that they are unavoidable regardless of implementation
26 * design.
30 #include <stdio.h>
31 #include <stdlib.h>
33 #include "config.h"
34 #include "global.h"
36 /* check for (level independent) parameter limits */
37 void range_checks()
41 /* identifies valid profile / level combinations */
42 static char profile_level_defined[5][4] =
44 /* HL H-14 ML LL */
45 {1, 1, 1, 0}, /* HP */
46 {0, 1, 0, 0}, /* Spat */
47 {0, 0, 1, 1}, /* SNR */
48 {1, 1, 1, 1}, /* MP */
49 {0, 0, 1, 0} /* SP */
52 static struct level_limits {
53 int hor_f_code;
54 int vert_f_code;
55 int hor_size;
56 int vert_size;
57 int sample_rate;
58 int bit_rate; /* Mbit/s */
59 int vbv_buffer_size; /* 16384 bit steps */
60 } maxval_tab[4] =
62 {9, 5, 1920, 1152, 62668800, 80, 597}, /* HL */
63 {9, 5, 1440, 1152, 47001600, 60, 448}, /* H-14 */
64 {8, 5, 720, 576, 10368000, 15, 112}, /* ML */
65 {7, 4, 352, 288, 3041280, 4, 29} /* LL */
68 #define SP 5
69 #define MP 4
70 #define SNR 3
71 #define SPAT 2
72 #define HP 1
74 #define LL 10
75 #define ML 8
76 #define H14 6
77 #define HL 4
79 void profile_and_level_checks()