OSDN Git Service

Adds a configuration option for whether the COLR atom and h.264 VUI header should...
[handbrake-jp/handbrake-jp-git.git] / libhb / common.h
index d772877..c00268d 100644 (file)
@@ -27,7 +27,7 @@
 
 #define EVEN( a )        ( (a) + ( (a) & 1 ) )
 #define MULTIPLE_16( a ) ( 16 * ( ( (a) + 8 ) / 16 ) )
-#define MULTIPLE_MOD( a, b ) ( b * ( ( (a) + (b / 2) ) / b ) )
+#define MULTIPLE_MOD( a, b ) ( b * ( ( (a) + (b / 2) - 1) / b ) )
 
 #define HB_DVD_READ_BUFFER_SIZE 2048
 
@@ -93,7 +93,6 @@ struct hb_mixdown_s
     int    amixdown;
 };
 
-#define HB_ASPECT_BASE 9
 #define HB_VIDEO_RATE_BASE   27000000
 
 extern hb_rate_t    hb_video_rates[];
@@ -133,12 +132,13 @@ struct hb_job_s
          width:               must be a multiple of 16
          height:              must be a multiple of 16
          keep_ratio:          used by UIs
+         grayscale:           black and white encoding
          pixel_ratio:         store pixel aspect ratio in the video
          pixel_aspect_width:  numerator for pixel aspect ratio
          pixel_aspect_height: denominator for pixel aspect ratio
-                maxWidth:                        keep width below this
-                maxHeight:                       keep height below this */
-
+         modulus:             set a number besides 16 for dimensions to be multiples of
+         maxWidth:            keep width below this
+         maxHeight:           keep height below this */
     int             crop[4];
     int             deinterlace;
     hb_list_t     * filters;
@@ -150,18 +150,21 @@ struct hb_job_s
     int             pixel_aspect_width;
     int             pixel_aspect_height;
     int             modulus;
-       int                             maxWidth;
-       int                             maxHeight;
-
+    int             maxWidth;
+    int             maxHeight;
 
     /* Video settings:
          vcodec:            output codec
          vquality:          output quality (0.0..1.0)
-                            if < 0.0 or > 1.0, bitrate is used instead
+                            if < 0.0 or > 1.0, bitrate is used instead,
+                            except with x264, to use its real QP/RF scale
          vbitrate:          output bitrate (kbps)
-         pass:              0, 1 or 2 (or -1 for scan)
          vrate, vrate_base: output framerate is vrate / vrate_base
-         h264_level:        boolean for whether or not we're encoding for iPod
+         vfr:               boolean for variable frame rate detelecine
+         cfr:               boolean to use constant frame rates instead of
+                            passing through the source's frame durations.
+         pass:              0, 1 or 2 (or -1 for scan)
+         h264_level:        vestigial boolean to decide if we're encoding for iPod
          crf:               boolean for whether to use constant rate factor with x264
          x264opts:          string of extra x264 options
          areBframes:        boolean to note if b-frames are included in x264opts */
@@ -176,13 +179,15 @@ struct hb_job_s
     int             vbitrate;
     int             vrate;
     int             vrate_base;
+    int             vfr;
+    int             cfr;
     int             pass;
     int             h264_13;
     int             h264_level;
     int             crf;
     char            *x264opts;
     int             areBframes;
-    int             vfr;
+    int             color_matrix;
 
     /* List of audio settings. */
     hb_list_t     * list_audio;
@@ -191,7 +196,7 @@ struct hb_job_s
          subtitle: index in hb_title_t's subtitles list, starting
          from 0. -1 means no subtitle */
     int             subtitle;
-    int                        subtitleSmartAdjust;
+    int             subtitleSmartAdjust;
 
     /* Muxer settings
          mux:  output file format
@@ -325,6 +330,7 @@ struct hb_audio_config_s
             int bitrate;    /* Output bitrate (kbps) */
             int mixdown;    /* The mixdown format to be used for this audio track (see HB_AMIXDOWN_*) */
             double dynamic_range_compression; /* Amount of DRC that gets applied to this track */
+            char * name;    /* Output track name */
     } out;
 
     /* Input */
@@ -434,9 +440,12 @@ struct hb_title_s
     /* Exact duration (in 1/90000s) */
     uint64_t    duration;
 
+    double      aspect;             // aspect ratio for the title's video
+    double      container_aspect;   // aspect ratio from container (0 if none)
     int         width;
     int         height;
-    int         aspect;
+    int         pixel_aspect_width;
+    int         pixel_aspect_height;
     int         rate;
     int         rate_base;
     int         crop[4];
@@ -445,6 +454,12 @@ struct hb_title_s
     int         video_id;               /* demuxer stream id for video */
     int         video_codec;            /* worker object id of video codec */
     int         video_codec_param;      /* codec specific config */
+    int         flaky_clock;            /* can lose reference clock */
+                                        /* (for over-the-air transport streams) */
+    const char  *video_codec_name;
+    int         video_bitrate;
+    const char  *container_name;
+    int         data_rate;
 
     uint32_t    palette[16];
 
@@ -521,6 +536,8 @@ typedef struct hb_work_info_s
         struct {    // info only valid for video decoders
             int     width;
             int     height;
+            int     pixel_aspect_width;
+            int     pixel_aspect_height;
             double  aspect;
         };
         struct {    // info only valid for audio decoders