OSDN Git Service

Added libhb and CLI support for Dolby Pro Logic II 5.0 matrix encoding. *NOT YET...
[handbrake-jp/handbrake-jp-git.git] / libhb / internal.h
index d241ae5..bc6f506 100644 (file)
@@ -12,7 +12,7 @@ void hb_log( char * log, ... );
 int  hb_list_bytes( hb_list_t * );
 void hb_list_seebytes( hb_list_t * l, uint8_t * dst, int size );
 void hb_list_getbytes( hb_list_t * l, uint8_t * dst, int size,
-                       uint64_t * pts, int * pos );
+                       uint64_t * pts, uint64_t * pos );
 void hb_list_empty( hb_list_t ** );
 
 hb_title_t * hb_title_init( char * dvd, int index );
@@ -27,7 +27,6 @@ void hb_set_state( hb_handle_t *, hb_state_t * );
 /***********************************************************************
  * fifo.c
  **********************************************************************/
-typedef struct hb_buffer_s hb_buffer_t;
 struct hb_buffer_s
 {
     int           size;
@@ -40,6 +39,9 @@ struct hb_buffer_s
     int64_t       stop;
     int           key;
 
+    /* Holds the output PTS from x264, for use by b-frame offsets in muxmp4.c */
+    int64_t     encodedPTS;
+
     int           x;
     int           y;
     int           width;
@@ -54,11 +56,11 @@ hb_buffer_t * hb_buffer_init( int size );
 void          hb_buffer_realloc( hb_buffer_t *, int size );
 void          hb_buffer_close( hb_buffer_t ** );
 
-typedef struct hb_fifo_s hb_fifo_t;
 
 hb_fifo_t   * hb_fifo_init();
 int           hb_fifo_size( hb_fifo_t * );
 int           hb_fifo_is_full( hb_fifo_t * );
+float         hb_fifo_percent_full( hb_fifo_t * f );
 hb_buffer_t * hb_fifo_get( hb_fifo_t * );
 hb_buffer_t * hb_fifo_see( hb_fifo_t * );
 hb_buffer_t * hb_fifo_see2( hb_fifo_t * );
@@ -115,21 +117,22 @@ void         hb_dvd_close( hb_dvd_t ** );
  * Work objects
  **********************************************************************/
 #define HB_CONFIG_MAX_SIZE 8192
-typedef union hb_esconfig_u
+union hb_esconfig_u
 {
+
     struct
     {
         uint8_t bytes[HB_CONFIG_MAX_SIZE];
         int     length;
     } mpeg4;
 
-    struct
-    {
-        uint8_t sps[HB_CONFIG_MAX_SIZE];
-        int     sps_length;
-        uint8_t pps[HB_CONFIG_MAX_SIZE];
-        int     pps_length;
-    } h264;
+       struct
+       {
+           uint8_t  sps[HB_CONFIG_MAX_SIZE];
+           int       sps_length;
+           uint8_t  pps[HB_CONFIG_MAX_SIZE];
+           int       pps_length;
+       } h264;
 
     struct
     {
@@ -140,30 +143,15 @@ typedef union hb_esconfig_u
     struct
     {
         uint8_t headers[3][HB_CONFIG_MAX_SIZE];
+        char *language;
     } vorbis;
-} hb_esconfig_t;
-
-typedef struct hb_work_private_s hb_work_private_t;
-typedef struct hb_work_object_s  hb_work_object_t;
-struct hb_work_object_s
-{
-    int                 id;
-    char              * name;
-
-    int              (* init)  ( hb_work_object_t *, hb_job_t * );
-    int              (* work)  ( hb_work_object_t *, hb_buffer_t **,
-                                 hb_buffer_t ** );
-    void             (* close) ( hb_work_object_t * );
-
-    hb_fifo_t         * fifo_in;
-    hb_fifo_t         * fifo_out;
-    hb_esconfig_t     * config;
-
-    hb_work_private_t * private_data;
+    
+    struct
+    {
+       /* ac3flags stores the flags from the AC3 source, as found in scan.c */
+       int  ac3flags;
+    } a52;
 
-    hb_lock_t         * lock;
-    int                 used;
-    uint64_t            time;
 };
 
 enum
@@ -183,19 +171,7 @@ enum
     WORK_ENCVORBIS
 };
 
-extern hb_work_object_t hb_sync;
-extern hb_work_object_t hb_decmpeg2;
-extern hb_work_object_t hb_decsub;
-extern hb_work_object_t hb_render;
-extern hb_work_object_t hb_encavcodec;
-extern hb_work_object_t hb_encxvid;
-extern hb_work_object_t hb_encx264;
-extern hb_work_object_t hb_deca52;
-extern hb_work_object_t hb_decavcodec;
-extern hb_work_object_t hb_declpcm;
-extern hb_work_object_t hb_encfaac;
-extern hb_work_object_t hb_enclame;
-extern hb_work_object_t hb_encvorbis;
+extern hb_work_object_t * hb_objects;
 
 #define HB_WORK_IDLE     0
 #define HB_WORK_OK       1