gavl
gavl.h
Go to the documentation of this file.
1 /*****************************************************************
2  * gavl - a general purpose audio/video processing library
3  *
4  * Copyright (c) 2001 - 2010 Members of the Gmerlin project
5  * gmerlin-general@lists.sourceforge.net
6  * http://gmerlin.sourceforge.net
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  * *****************************************************************/
21 
27 #ifndef GAVL_H_INCLUDED
28 #define GAVL_H_INCLUDED
29 
30 #include <inttypes.h>
31 
32 #include <gavl/gavldefs.h>
33 #include <gavl/gavltime.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 #include <gavl/timecode.h>
40 
41 
64 typedef void (*gavl_video_process_func)(void * data, int start, int end);
65 
80  void * gavl_data,
81  int start, int end,
82  void * client_data, int thread);
83 
92 typedef void (*gavl_video_stop_func)(void * client_data, int thread);
93 
103 
104 
105 /* Quality levels */
106 
130 #define GAVL_QUALITY_FASTEST 1
131 
138 #define GAVL_QUALITY_BEST 5
139 
146 #define GAVL_QUALITY_DEFAULT 2
147 
159 #define GAVL_ACCEL_MMX (1<<0)
160 #define GAVL_ACCEL_MMXEXT (1<<1)
161 #define GAVL_ACCEL_SSE (1<<2)
162 #define GAVL_ACCEL_SSE2 (1<<3)
163 #define GAVL_ACCEL_SSE3 (1<<4)
164 #define GAVL_ACCEL_3DNOW (1<<5)
165 #define GAVL_ACCEL_3DNOWEXT (1<<6)
166 #define GAVL_ACCEL_SSSE3 (1<<7)
167 
168 
172 GAVL_PUBLIC int gavl_accel_supported();
173 
182 /* Sample formats: all multibyte numbers are native endian */
183 
196 #define GAVL_MAX_CHANNELS 128
197 
204 typedef enum
205  {
215 
221 typedef enum
222  {
227 
235 typedef enum
236  {
251 
260 typedef struct
261  {
268  float center_level;
269  float rear_level;
274 
275 
276 /* Audio format -> string conversions */
277 
285 GAVL_PUBLIC
287 
296 GAVL_PUBLIC
298 
304 GAVL_PUBLIC
306 
313 GAVL_PUBLIC
315 
322 GAVL_PUBLIC
324 
325 
332 GAVL_PUBLIC
334 
341 GAVL_PUBLIC
342 void gavl_audio_format_dump(const gavl_audio_format_t * format);
343 
352 GAVL_PUBLIC
354 
361 GAVL_PUBLIC
362 int gavl_front_channels(const gavl_audio_format_t * format);
363 
370 GAVL_PUBLIC
371 int gavl_rear_channels(const gavl_audio_format_t * format);
372 
379 GAVL_PUBLIC
380 int gavl_side_channels(const gavl_audio_format_t * format);
381 
388 GAVL_PUBLIC
389 int gavl_aux_channels(const gavl_audio_format_t * format);
390 
391 
392 
399 GAVL_PUBLIC
400 int gavl_lfe_channels(const gavl_audio_format_t * format);
401 
409 GAVL_PUBLIC
411  const gavl_audio_format_t * src);
412 
421 GAVL_PUBLIC
422 int gavl_audio_formats_equal(const gavl_audio_format_t * format_1,
423  const gavl_audio_format_t * format_2);
424 
436 GAVL_PUBLIC
438 
445 GAVL_PUBLIC
447 
462 typedef union
463  {
464  uint8_t * u_8;
465  int8_t * s_8;
467  uint16_t * u_16;
468  int16_t * s_16;
470  uint32_t * u_32;
471  int32_t * s_32;
473  float * f;
474  double * d;
476 
482 typedef union
483  {
484  uint8_t * u_8[GAVL_MAX_CHANNELS];
485  int8_t * s_8[GAVL_MAX_CHANNELS];
487  uint16_t * u_16[GAVL_MAX_CHANNELS];
488  int16_t * s_16[GAVL_MAX_CHANNELS];
490  uint32_t * u_32[GAVL_MAX_CHANNELS];
491  int32_t * s_32[GAVL_MAX_CHANNELS];
493  float * f[GAVL_MAX_CHANNELS];
494  double * d[GAVL_MAX_CHANNELS];
497 
514 typedef struct
515  {
519  int64_t timestamp;
522 
534 GAVL_PUBLIC
536 
548 GAVL_PUBLIC
550 
560 GAVL_PUBLIC
562 
572 GAVL_PUBLIC
574  const gavl_audio_format_t * format);
575 
586 GAVL_PUBLIC
588  const gavl_audio_format_t * format,
589  int num_samples);
590 
591 
592 
603 GAVL_PUBLIC
605  const gavl_audio_format_t * format,
606  int channel);
607 
628 GAVL_PUBLIC
629 int gavl_audio_frame_copy(const gavl_audio_format_t * format,
630  gavl_audio_frame_t * dst,
631  const gavl_audio_frame_t * src,
632  int dst_pos,
633  int src_pos,
634  int dst_size,
635  int src_size);
636 
649 GAVL_PUBLIC
651  gavl_audio_frame_t * dst,
652  const gavl_audio_frame_t * src);
653 
671 GAVL_PUBLIC
673  gavl_audio_frame_t * src,
674  gavl_audio_frame_t * dst,
675  int start, int len);
676 
691 #define GAVL_AUDIO_FRONT_TO_REAR_COPY (1<<0)
696 #define GAVL_AUDIO_FRONT_TO_REAR_MUTE (1<<1)
701 #define GAVL_AUDIO_FRONT_TO_REAR_DIFF (1<<2)
706 #define GAVL_AUDIO_FRONT_TO_REAR_MASK \
707 (GAVL_AUDIO_FRONT_TO_REAR_COPY | \
708 GAVL_AUDIO_FRONT_TO_REAR_MUTE | \
709  GAVL_AUDIO_FRONT_TO_REAR_DIFF)
711 /* Options for mixing stereo to mono */
712 
715 #define GAVL_AUDIO_STEREO_TO_MONO_LEFT (1<<3)
718 #define GAVL_AUDIO_STEREO_TO_MONO_RIGHT (1<<4)
721 #define GAVL_AUDIO_STEREO_TO_MONO_MIX (1<<5)
725 #define GAVL_AUDIO_STEREO_TO_MONO_MASK \
726 (GAVL_AUDIO_STEREO_TO_MONO_LEFT | \
727 GAVL_AUDIO_STEREO_TO_MONO_RIGHT | \
728 GAVL_AUDIO_STEREO_TO_MONO_MIX)
733 #define GAVL_AUDIO_NORMALIZE_MIX_MATRIX (1<<6)
740 typedef enum
741  {
742  GAVL_AUDIO_DITHER_NONE = 0,
743  GAVL_AUDIO_DITHER_AUTO = 1,
744  GAVL_AUDIO_DITHER_RECT = 2,
745  GAVL_AUDIO_DITHER_TRI = 3,
746  GAVL_AUDIO_DITHER_SHAPED = 4,
748 
753 typedef enum
754  {
762 
769 typedef struct gavl_audio_options_s gavl_audio_options_t;
770 
777 GAVL_PUBLIC
779 
786 GAVL_PUBLIC
788 
795 GAVL_PUBLIC
797 
804 GAVL_PUBLIC
806 
807 
814 GAVL_PUBLIC
816 
823 GAVL_PUBLIC
825 
832 GAVL_PUBLIC
834  int flags);
835 
842 GAVL_PUBLIC
844 
850 GAVL_PUBLIC
852 
869 GAVL_PUBLIC
871  const double ** matrix);
872 
881 GAVL_PUBLIC
883 
893 GAVL_PUBLIC
895 
902 GAVL_PUBLIC
904  const gavl_audio_options_t * src);
905 
911 GAVL_PUBLIC
913 
914 
915 
916 /* Audio converter */
917 
951 typedef struct gavl_audio_converter_s gavl_audio_converter_t;
952 
958 GAVL_PUBLIC
960 
966 GAVL_PUBLIC
968 
977 GAVL_PUBLIC
979 
980 
995 GAVL_PUBLIC
997  const gavl_audio_format_t * input_format,
998  const gavl_audio_format_t * output_format);
999 
1014 GAVL_PUBLIC
1016  const gavl_audio_format_t * format);
1017 
1032 GAVL_PUBLIC
1034 
1035 
1049 GAVL_PUBLIC
1051  const gavl_audio_frame_t * input_frame,
1052  gavl_audio_frame_t * output_frame);
1053 
1054 
1073 GAVL_PUBLIC
1075  double ratio ) ;
1076 
1077 
1093 GAVL_PUBLIC
1095  gavl_audio_frame_t * input_frame,
1096  gavl_audio_frame_t * output_frame,
1097  double ratio);
1098 
1099 
1113 typedef struct gavl_volume_control_s gavl_volume_control_t;
1114 
1115 /* Create / destroy */
1116 
1122 GAVL_PUBLIC
1124 
1130 GAVL_PUBLIC
1132 
1140 GAVL_PUBLIC
1142  const gavl_audio_format_t * format);
1143 
1150 GAVL_PUBLIC
1152  float volume);
1153 
1160 GAVL_PUBLIC
1162  gavl_audio_frame_t * frame);
1163 
1179 typedef struct gavl_peak_detector_s gavl_peak_detector_t;
1180 
1181 /* Create / destroy */
1182 
1188 GAVL_PUBLIC
1190 
1196 GAVL_PUBLIC
1198 
1208 GAVL_PUBLIC
1210  const gavl_audio_format_t * format);
1211 
1218 GAVL_PUBLIC
1220  gavl_audio_frame_t * frame);
1221 
1234 GAVL_PUBLIC
1236  double * min, double * max,
1237  double * abs);
1238 
1251 GAVL_PUBLIC
1253  double * min, double * max,
1254  double * abs);
1255 
1261 GAVL_PUBLIC
1263 
1273 #define GAVL_MAX_PLANES 4
1285 typedef struct
1286  {
1287  int x;
1288  int y;
1289  int w;
1290  int h;
1292 
1297 typedef struct
1298  {
1299  double x;
1300  double y;
1301  double w;
1302  double h;
1304 
1311 GAVL_PUBLIC
1313  const gavl_video_format_t * format);
1314 
1321 GAVL_PUBLIC
1323  const gavl_video_format_t * format);
1324 
1339 GAVL_PUBLIC
1341  gavl_rectangle_i_t * dst_rect,
1342  const gavl_video_format_t * src_format,
1343  const gavl_video_format_t * dst_format);
1344 
1356 GAVL_PUBLIC
1358  gavl_rectangle_i_t * dst_rect,
1359  const gavl_video_format_t * src_format,
1360  const gavl_video_format_t * dst_format);
1361 
1362 
1363 
1370 GAVL_PUBLIC
1372 
1379 GAVL_PUBLIC
1381 
1388 GAVL_PUBLIC
1389 void gavl_rectangle_i_crop_left(gavl_rectangle_i_t * r, int num_pixels);
1390 
1397 GAVL_PUBLIC
1398 void gavl_rectangle_i_crop_right(gavl_rectangle_i_t * r, int num_pixels);
1399 
1406 GAVL_PUBLIC
1407 void gavl_rectangle_i_crop_top(gavl_rectangle_i_t * r, int num_pixels);
1408 
1415 GAVL_PUBLIC
1416 void gavl_rectangle_i_crop_bottom(gavl_rectangle_i_t * r, int num_pixels);
1417 
1424 GAVL_PUBLIC
1425 void gavl_rectangle_f_crop_left(gavl_rectangle_f_t * r, double num_pixels);
1426 
1433 GAVL_PUBLIC
1434 void gavl_rectangle_f_crop_right(gavl_rectangle_f_t * r, double num_pixels);
1435 
1442 GAVL_PUBLIC
1443 void gavl_rectangle_f_crop_top(gavl_rectangle_f_t * r, double num_pixels);
1444 
1451 GAVL_PUBLIC
1452 void gavl_rectangle_f_crop_bottom(gavl_rectangle_f_t * r, double num_pixels);
1453 
1467 GAVL_PUBLIC
1468 void gavl_rectangle_i_align(gavl_rectangle_i_t * r, int h_align, int v_align);
1469 
1479 GAVL_PUBLIC
1481  const gavl_video_format_t * format);
1482 
1483 
1490 GAVL_PUBLIC
1492 
1499 GAVL_PUBLIC
1501 
1502 
1503 
1510 GAVL_PUBLIC
1512 
1519 GAVL_PUBLIC
1521 
1530 GAVL_PUBLIC
1532 
1541 GAVL_PUBLIC
1543 
1571 GAVL_PUBLIC
1573  const gavl_video_format_t * src_format,
1574  const gavl_rectangle_f_t * src_rect,
1575  const gavl_video_format_t * dst_format,
1576  float zoom, float squeeze);
1577 
1582 GAVL_PUBLIC
1584 
1589 GAVL_PUBLIC
1591 
1592 
1602 #define GAVL_PIXFMT_PLANAR (1<<8)
1603 
1607 #define GAVL_PIXFMT_RGB (1<<9)
1608 
1612 #define GAVL_PIXFMT_YUV (1<<10)
1613 
1617 #define GAVL_PIXFMT_YUVJ (1<<11)
1618 
1622 #define GAVL_PIXFMT_ALPHA (1<<12)
1623 
1627 #define GAVL_PIXFMT_GRAY (1<<13)
1628 
1633 typedef enum
1634  {
1638 
1642 
1646 
1650 
1654 
1658 
1662 
1694 
1701 
1708 
1724 
1728 
1745 
1755 
1762 
1764 
1767 #define GAVL_PIXELFORMAT_1D_8 GAVL_GRAY_8
1768 
1770 #define GAVL_PIXELFORMAT_2D_8 GAVL_GRAYA_16
1771 
1773 #define GAVL_PIXELFORMAT_3D_8 GAVL_RGB_24
1774 
1776 #define GAVL_PIXELFORMAT_4D_8 GAVL_RGBA_32
1777 
1780 #define GAVL_PIXELFORMAT_1D_16 GAVL_GRAY_16
1781 
1783 #define GAVL_PIXELFORMAT_2D_16 GAVL_GRAYA_32
1784 
1786 #define GAVL_PIXELFORMAT_3D_16 GAVL_RGB_48
1787 
1789 #define GAVL_PIXELFORMAT_4D_16 GAVL_RGBA_64
1790 
1793 #define GAVL_PIXELFORMAT_1D_FLOAT GAVL_GRAY_FLOAT
1794 
1796 #define GAVL_PIXELFORMAT_2D_FLOAT GAVL_GRAYA_FLOAT
1797 
1799 #define GAVL_PIXELFORMAT_3D_FLOAT GAVL_RGB_FLOAT
1800 
1802 #define GAVL_PIXELFORMAT_4D_FLOAT GAVL_RGBA_FLOAT
1803 
1810 typedef enum
1811  {
1820 
1821 /*
1822  * Colormodel related functions
1823  */
1824 
1831 #define gavl_pixelformat_is_gray(fmt) ((fmt) & GAVL_PIXFMT_GRAY)
1832 
1833 
1840 #define gavl_pixelformat_is_rgb(fmt) ((fmt) & GAVL_PIXFMT_RGB)
1841 
1848 #define gavl_pixelformat_is_yuv(fmt) ((fmt) & GAVL_PIXFMT_YUV)
1849 
1856 #define gavl_pixelformat_is_jpeg_scaled(fmt) ((fmt) & GAVL_PIXFMT_YUVJ)
1857 
1864 #define gavl_pixelformat_has_alpha(fmt) ((fmt) & GAVL_PIXFMT_ALPHA)
1865 
1872 #define gavl_pixelformat_is_planar(fmt) ((fmt) & GAVL_PIXFMT_PLANAR)
1873 
1880 GAVL_PUBLIC
1882 
1892 GAVL_PUBLIC
1893 void gavl_pixelformat_chroma_sub(gavl_pixelformat_t pixelformat, int * sub_h, int * sub_v);
1894 
1901 GAVL_PUBLIC
1903 
1910 GAVL_PUBLIC
1912 
1919 GAVL_PUBLIC
1921 
1936 GAVL_PUBLIC
1938  gavl_pixelformat_t dst);
1939 
1953 GAVL_PUBLIC gavl_pixelformat_t
1955  const gavl_pixelformat_t * dst_supported,
1956  int * penalty);
1957 
1958 
1959 
1966 GAVL_PUBLIC
1967 const char * gavl_pixelformat_to_string(gavl_pixelformat_t pixelformat);
1968 
1975 GAVL_PUBLIC
1977 
1983 GAVL_PUBLIC
1984 int gavl_num_pixelformats();
1985 
1992 GAVL_PUBLIC
1994 
1995 /* */
1996 
2005 typedef enum
2006  {
2011 
2018 GAVL_PUBLIC
2020 
2025 typedef enum
2026  {
2031 
2036 typedef enum
2037  {
2043 
2050 GAVL_PUBLIC
2052 
2053 
2054 /* Video format structure */
2055 
2061  {
2068  /* Support for nonsquare pixels */
2069 
2085  };
2086 
2094 GAVL_PUBLIC
2096  const gavl_video_format_t * src);
2097 
2106 GAVL_PUBLIC
2107 int gavl_video_formats_equal(const gavl_video_format_t * format_1,
2108  const gavl_video_format_t * format_2);
2109 
2110 
2121 GAVL_PUBLIC
2122 void gavl_video_format_get_chroma_offset(const gavl_video_format_t * format, int field, int plane,
2123  float * off_x, float * off_y);
2124 
2125 
2126 
2139 GAVL_PUBLIC
2141  const gavl_video_format_t * src);
2142 
2150 GAVL_PUBLIC
2152 
2168 GAVL_PUBLIC
2169 int gavl_get_color_channel_format(const gavl_video_format_t * frame_format,
2170  gavl_video_format_t * channel_format,
2172 
2173 
2180 GAVL_PUBLIC
2181 void gavl_video_format_dump(const gavl_video_format_t * format);
2182 
2183 
2206 typedef struct
2207  {
2208  uint8_t * planes[GAVL_MAX_PLANES];
2209  int strides[GAVL_MAX_PLANES];
2211  void * user_data;
2212  int64_t timestamp;
2213  int64_t duration;
2217 
2218 
2230 GAVL_PUBLIC
2232 
2243 GAVL_PUBLIC
2245 
2246 
2247 
2257 GAVL_PUBLIC
2259 
2271 GAVL_PUBLIC
2273 
2282 GAVL_PUBLIC
2284  const gavl_video_format_t * format);
2285 
2295 GAVL_PUBLIC
2297  const gavl_video_format_t * format,
2298  const float * color);
2299 
2312 GAVL_PUBLIC
2314  const gavl_video_frame_t * src1,
2315  const gavl_video_frame_t * src2,
2316  const gavl_video_format_t * format);
2317 
2330 GAVL_PUBLIC
2331 void gavl_video_frame_psnr(double * psnr,
2332  const gavl_video_frame_t * src1,
2333  const gavl_video_frame_t * src2,
2334  const gavl_video_format_t * format);
2335 
2362 GAVL_PUBLIC
2363 int gavl_video_frame_ssim(const gavl_video_frame_t * src1,
2364  const gavl_video_frame_t * src2,
2365  gavl_video_frame_t * dst,
2366  const gavl_video_format_t * format);
2367 
2381 GAVL_PUBLIC
2382 void gavl_video_frame_copy(const gavl_video_format_t * format,
2383  gavl_video_frame_t * dst,
2384  const gavl_video_frame_t * src);
2385 
2398 GAVL_PUBLIC
2400  gavl_video_frame_t * dst,
2401  const gavl_video_frame_t * src, int plane);
2402 
2414 GAVL_PUBLIC
2416  gavl_video_frame_t * dst,
2417  const gavl_video_frame_t * src);
2418 
2430 GAVL_PUBLIC
2432  gavl_video_frame_t * dst,
2433  const gavl_video_frame_t * src);
2434 
2446 GAVL_PUBLIC
2448  gavl_video_frame_t * dst,
2449  const gavl_video_frame_t * src);
2450 
2463 GAVL_PUBLIC
2465  const gavl_video_frame_t * src);
2466 
2467 
2485 GAVL_PUBLIC
2487  const gavl_video_frame_t * src,
2488  gavl_video_frame_t * dst,
2489  gavl_rectangle_i_t * src_rect);
2490 
2506 GAVL_PUBLIC
2508  const gavl_video_frame_t * src,
2509  gavl_video_frame_t * dst,
2510  int field);
2511 
2512 
2513 
2526 GAVL_PUBLIC
2528  const gavl_video_format_t * format,
2529  const char * namebase);
2530 
2541 GAVL_PUBLIC
2543  const gavl_video_format_t * format);
2544 
2557 GAVL_PUBLIC
2559  const gavl_video_format_t * format,
2560  uint8_t * buffer);
2561 
2576 GAVL_PUBLIC
2579  const gavl_video_frame_t * src,
2580  gavl_video_frame_t * dst);
2581 
2597 GAVL_PUBLIC
2600  const gavl_video_frame_t * src,
2601  gavl_video_frame_t * dst);
2602 
2603 
2604 
2605 
2606 /*****************************
2607  Conversion options
2608 ******************************/
2609 
2625 #define GAVL_FORCE_DEINTERLACE (1<<0)
2626 
2631 #define GAVL_CONVOLVE_CHROMA (1<<1)
2632 
2637 #define GAVL_CONVOLVE_NORMALIZE (1<<2)
2638 
2646 #define GAVL_RESAMPLE_CHROMA (1<<3)
2647 
2655 typedef enum
2656  {
2660 
2667 typedef enum
2668  {
2674 
2681 typedef enum
2682  {
2686 
2691 typedef enum
2692  {
2703 
2713 typedef enum
2714  {
2720 
2727 typedef struct gavl_video_options_s gavl_video_options_t;
2728 
2729 /* Default Options */
2730 
2736 GAVL_PUBLIC
2738 
2748 GAVL_PUBLIC
2750 
2757 GAVL_PUBLIC
2759  const gavl_video_options_t * src);
2760 
2766 GAVL_PUBLIC
2768 
2769 
2784 GAVL_PUBLIC
2786  const gavl_rectangle_f_t * src_rect,
2787  const gavl_rectangle_i_t * dst_rect);
2788 
2796 GAVL_PUBLIC
2798  gavl_rectangle_f_t * src_rect,
2799  gavl_rectangle_i_t * dst_rect);
2800 
2807 GAVL_PUBLIC
2808 void gavl_video_options_set_quality(gavl_video_options_t * opt, int quality);
2809 
2816 GAVL_PUBLIC
2818 
2819 
2826 GAVL_PUBLIC
2828  int conversion_flags);
2829 
2836 GAVL_PUBLIC
2838 
2845 GAVL_PUBLIC
2847  gavl_alpha_mode_t alpha_mode);
2848 
2855 GAVL_PUBLIC gavl_alpha_mode_t
2857 
2858 
2865 GAVL_PUBLIC
2867  gavl_scale_mode_t scale_mode);
2868 
2875 GAVL_PUBLIC gavl_scale_mode_t
2877 
2878 
2885 GAVL_PUBLIC
2887  int order);
2888 
2895 GAVL_PUBLIC
2897 
2898 
2905 GAVL_PUBLIC
2907  const float * color);
2908 
2915 GAVL_PUBLIC
2917  float * color);
2918 
2925 GAVL_PUBLIC
2927  gavl_deinterlace_mode_t deinterlace_mode);
2928 
2935 GAVL_PUBLIC gavl_deinterlace_mode_t
2937 
2944 GAVL_PUBLIC
2946  gavl_deinterlace_drop_mode_t deinterlace_drop_mode);
2947 
2954 GAVL_PUBLIC gavl_deinterlace_drop_mode_t
2956 
2965 GAVL_PUBLIC
2968 
2969 
2978 GAVL_PUBLIC gavl_downscale_filter_t
2980 
2998 GAVL_PUBLIC
3000  float f);
3001 
3010 GAVL_PUBLIC
3012 
3021 GAVL_PUBLIC
3023 
3024 
3033 GAVL_PUBLIC
3035 
3045 GAVL_PUBLIC
3047  gavl_video_run_func func,
3048  void * client_data);
3049 
3059 GAVL_PUBLIC
3061  void ** client_data);
3062 
3072 GAVL_PUBLIC
3074  gavl_video_stop_func func,
3075  void * client_data);
3076 
3086 GAVL_PUBLIC
3088  void ** client_data);
3089 
3090 
3091 /***************************************************
3092  * Create and destroy video converters
3093  ***************************************************/
3094 
3127 typedef struct gavl_video_converter_s gavl_video_converter_t;
3128 
3134 GAVL_PUBLIC
3136 
3142 GAVL_PUBLIC
3144 
3145 /**************************************************
3146  * Get options. Change the options with the gavl_video_options_set_*
3147  * functions above
3148  **************************************************/
3149 
3158 GAVL_PUBLIC gavl_video_options_t *
3160 
3161 
3175 GAVL_PUBLIC
3177  const gavl_video_format_t * input_format,
3178  const gavl_video_format_t * output_format);
3179 
3192 GAVL_PUBLIC
3194 
3195 
3196 /***************************************************
3197  * Convert a frame
3198  ***************************************************/
3199 
3207 GAVL_PUBLIC
3209  const gavl_video_frame_t * input_frame,
3210  gavl_video_frame_t * output_frame);
3211 
3243 typedef struct gavl_video_scaler_s gavl_video_scaler_t;
3244 
3250 GAVL_PUBLIC
3252 
3258 GAVL_PUBLIC
3260 
3269 GAVL_PUBLIC gavl_video_options_t *
3271 
3284 GAVL_PUBLIC
3286  const gavl_video_format_t * src_format,
3287  const gavl_video_format_t * dst_format);
3288 
3310 GAVL_PUBLIC
3312  const gavl_video_format_t * format,
3313  int h_radius, const float * h_coeffs,
3314  int v_radius, const float * v_coeffs);
3315 
3323 GAVL_PUBLIC
3325  const gavl_video_frame_t * input_frame,
3326  gavl_video_frame_t * output_frame);
3327 
3343 typedef struct gavl_video_deinterlacer_s gavl_video_deinterlacer_t;
3344 
3350 GAVL_PUBLIC
3352 
3358 GAVL_PUBLIC
3360 
3369 GAVL_PUBLIC gavl_video_options_t *
3371 
3382 GAVL_PUBLIC
3384  const gavl_video_format_t * src_format);
3385 
3386 
3394 GAVL_PUBLIC
3396  const gavl_video_frame_t * input_frame,
3397  gavl_video_frame_t * output_frame);
3398 
3399 
3400 
3401 /**************************************************
3402  * Transparent overlays
3403  **************************************************/
3404 
3405 /* Overlay struct */
3406 
3434 typedef struct
3435  {
3438  int dst_x;
3439  int dst_y;
3440  } gavl_overlay_t;
3441 
3448 typedef struct gavl_overlay_blend_context_s gavl_overlay_blend_context_t;
3449 
3455 GAVL_PUBLIC
3457 
3463 GAVL_PUBLIC
3465 
3472 GAVL_PUBLIC gavl_video_options_t *
3474 
3490 GAVL_PUBLIC
3492  const gavl_video_format_t * frame_format,
3493  gavl_video_format_t * overlay_format);
3494 
3504 GAVL_PUBLIC
3506  gavl_overlay_t * ovl);
3507 
3514 GAVL_PUBLIC
3516  gavl_video_frame_t * dst_frame);
3517 
3539 typedef struct gavl_image_transform_s gavl_image_transform_t;
3540 
3554 typedef void (*gavl_image_transform_func)(void * priv,
3555  double xdst,
3556  double ydst,
3557  double * xsrc,
3558  double * ysrc);
3559 
3560 
3567 GAVL_PUBLIC
3569 
3575 GAVL_PUBLIC
3577 
3596 GAVL_PUBLIC
3598  gavl_video_format_t * format,
3599  gavl_image_transform_func func, void * priv);
3600 
3608 GAVL_PUBLIC
3610  gavl_video_frame_t * in_frame,
3611  gavl_video_frame_t * out_frame);
3612 
3623 GAVL_PUBLIC gavl_video_options_t *
3625 
3648 typedef struct
3649  {
3650  int64_t offset;
3651  /* Primary */
3652  int64_t num_entries;
3653  int64_t entries_alloc;
3654 
3655  struct
3656  {
3657  int64_t num_frames;
3658  int64_t duration;
3659  } * entries;
3660 
3663 
3664  struct
3665  {
3666  int64_t pts;
3668  } * timecodes;
3669 
3670  /* Secondary */
3671 
3673 
3680 
3691 GAVL_PUBLIC gavl_frame_table_t *
3692 gavl_frame_table_create_audio(int samplerate, int64_t offset, int64_t duration,
3693  gavl_timecode_format_t * fmt_ret);
3694 
3706 GAVL_PUBLIC gavl_frame_table_t *
3707 gavl_frame_table_create_cfr(int64_t offset, int64_t frame_duration,
3708  int64_t num_frames,
3709  gavl_timecode_t start_timecode);
3710 
3718 GAVL_PUBLIC gavl_frame_table_t *
3720 
3721 
3722 
3729 GAVL_PUBLIC void gavl_frame_table_destroy(gavl_frame_table_t * t);
3730 
3738 GAVL_PUBLIC void gavl_frame_table_append_entry(gavl_frame_table_t * t, int64_t duration);
3739 
3748 GAVL_PUBLIC void
3750  int64_t pts, gavl_timecode_t tc);
3751 
3762 GAVL_PUBLIC int64_t
3764  int64_t frame, int * duration);
3765 
3776 GAVL_PUBLIC int64_t
3778  int64_t time,
3779  int64_t * start_time);
3780 
3791 GAVL_PUBLIC gavl_timecode_t
3793  int64_t time,
3794  int64_t * start_time,
3795  const gavl_timecode_format_t * fmt);
3796 
3806 GAVL_PUBLIC int64_t
3808  gavl_timecode_t tc,
3809  const gavl_timecode_format_t * fmt);
3810 
3811 
3822 GAVL_PUBLIC gavl_timecode_t
3824  int64_t frame,
3825  int64_t * start_time,
3826  const gavl_timecode_format_t * fmt);
3827 
3828 
3829 
3837 GAVL_PUBLIC int64_t
3839 
3847 GAVL_PUBLIC int64_t
3849 
3857 GAVL_PUBLIC int64_t
3859 
3868 GAVL_PUBLIC
3870  const char * filename);
3871 
3879 GAVL_PUBLIC
3880 gavl_frame_table_t * gavl_frame_table_load(const char * filename);
3881 
3888 GAVL_PUBLIC void
3890 
3891 
3892 
3893 
3894 
3895 
3901 #ifdef __cplusplus
3902 }
3903 #endif
3904 
3905 #endif /* GAVL_H_INCLUDED */
uint16_t * u_16
Definition: gavl.h:467
GAVL_PUBLIC int gavl_audio_formats_equal(const gavl_audio_format_t *format_1, const gavl_audio_format_t *format_2)
Compare 2 audio formats.
void(* gavl_image_transform_func)(void *priv, double xdst, double ydst, double *xsrc, double *ysrc)
Function describing the method.
Definition: gavl.h:3554
struct gavl_volume_control_s gavl_volume_control_t
Opaque structure for a volume control.
Definition: gavl.h:1113
Definition: gavl.h:225
GAVL_PUBLIC void gavl_video_frame_copy_flip_x(const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src)
Copy one video frame to another with horizontal flipping.
Generic container for audio samples.
Definition: gavl.h:514
GAVL_PUBLIC void gavl_video_deinterlacer_destroy(gavl_video_deinterlacer_t *deinterlacer)
Destroy a video deinterlacer.
gavl_timecode_t tc
Timecode associated with this timestamp.
Definition: gavl.h:3667
Timecode format.
Definition: timecode.h:59
GAVL_PUBLIC void gavl_peak_detector_get_peaks(gavl_peak_detector_t *pd, double *min, double *max, double *abs)
Get the peak volume for all channels separate.
struct gavl_audio_options_s gavl_audio_options_t
Opaque container for audio conversion options.
Definition: gavl.h:769
Definition: gavl.h:1641
GAVL_PUBLIC int gavl_pixelformat_bytes_per_component(gavl_pixelformat_t pixelformat)
Get bytes per component for planar formats.
GAVL_PUBLIC void gavl_video_frame_copy(const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src)
Copy one video frame to another.
gavl_alpha_mode_t
Definition: gavl.h:2655
GAVL_PUBLIC void gavl_audio_frame_null(gavl_audio_frame_t *frame)
Zero all pointers in the audio frame.
GAVL_PUBLIC void gavl_pixelformat_chroma_sub(gavl_pixelformat_t pixelformat, int *sub_h, int *sub_v)
Get the horizontal and vertical subsampling factors.
void * user_data
Definition: gavl.h:2211
GAVL_PUBLIC gavl_sample_format_t gavl_string_to_sample_format(const char *str)
Convert a string to a sample format.
int dst_y
y offset in the destination frame. */
Definition: gavl.h:3439
int32_t * s_32
Definition: gavl.h:471
GAVL_PUBLIC void gavl_volume_control_set_volume(gavl_volume_control_t *ctrl, float volume)
Set volume for a volume control.
GAVL_PUBLIC int gavl_video_options_get_scale_order(gavl_video_options_t *opt)
Get the scale order for GAVL_SCALE_SINC_LANCZOS.
double h
Definition: gavl.h:1302
GAVL_PUBLIC gavl_audio_options_t * gavl_audio_options_create()
Create an options container.
GAVL_PUBLIC gavl_sample_format_t gavl_get_sample_format(int index)
Get the sample format from index.
Definition: gavl.h:1666
GAVL_PUBLIC int gavl_rectangle_i_is_empty(const gavl_rectangle_i_t *r)
Check if an integer rectangle is empty.
GAVL_PUBLIC void gavl_video_format_fit_to_source(gavl_video_format_t *dst, const gavl_video_format_t *src)
Set the image size of a destination format from a source format.
GAVL_PUBLIC gavl_video_options_t * gavl_video_scaler_get_options(gavl_video_scaler_t *scaler)
gets options of a scaler
GAVL_PUBLIC int gavl_num_sample_formats()
Get total number of supported sample formats.
GAVL_PUBLIC void gavl_rectangle_i_crop_to_format(gavl_rectangle_i_t *r, const gavl_video_format_t *format)
Crop an integer rectangle so it fits into the image size of a video format.
GAVL_PUBLIC gavl_audio_frame_t * gavl_audio_frame_create(const gavl_audio_format_t *format)
Create audio frame.
Definition: gavl.h:1741
GAVL_PUBLIC void gavl_rectangle_crop_to_format_noscale(gavl_rectangle_i_t *src_rect, gavl_rectangle_i_t *dst_rect, const gavl_video_format_t *src_format, const gavl_video_format_t *dst_format)
Set 2 rectangles as source and destination when no scaling is available.
GAVL_PUBLIC const char * gavl_channel_id_to_string(gavl_channel_id_t id)
Convert a gavl_channel_id_t to a human readable string.
GAVL_PUBLIC void gavl_set_channel_setup(gavl_audio_format_t *format)
Set the default channel setup and indices.
GAVL_PUBLIC const char * gavl_chroma_placement_to_string(gavl_chroma_placement_t mode)
Translate a chroma placement into a human readable string.
GAVL_PUBLIC int gavl_rear_channels(const gavl_audio_format_t *format)
Get number of rear channels for a given format.
GAVL_PUBLIC int64_t gavl_frame_table_timecode_to_time(const gavl_frame_table_t *t, gavl_timecode_t tc, const gavl_timecode_format_t *fmt)
Convert a timecode to a timestamp.
gavl_audio_samples_t samples
Definition: gavl.h:516
GAVL_PUBLIC gavl_pixelformat_t gavl_string_to_pixelformat(const char *name)
Translate a pixelformat name into a pixelformat.
gavl_pixelformat_t
Pixelformat definition.
Definition: gavl.h:1633
gavl_downscale_filter_t
Definition: gavl.h:2713
void(* gavl_video_run_func)(gavl_video_process_func func, void *gavl_data, int start, int end, void *client_data, int thread)
Run a piece of a calculation.
Definition: gavl.h:79
GAVL_PUBLIC void gavl_volume_control_destroy(gavl_volume_control_t *ctrl)
Destroys a volume control and frees all associated memory.
void(* gavl_video_process_func)(void *data, int start, int end)
Prototype of a process function.
Definition: gavl.h:64
GAVL_PUBLIC void gavl_video_options_set_scale_mode(gavl_video_options_t *opt, gavl_scale_mode_t scale_mode)
Set the scale mode.
gavl_scale_mode_t
Definition: gavl.h:2691
GAVL_PUBLIC void gavl_video_options_get_background_color(gavl_video_options_t *opt, float *color)
Get the background color for alpha blending.
GAVL_PUBLIC void gavl_audio_convert(gavl_audio_converter_t *cnv, const gavl_audio_frame_t *input_frame, gavl_audio_frame_t *output_frame)
Convert audio.
Definition: gavl.h:244
gavl_channel_id_t
Audio channel setup.
Definition: gavl.h:235
Definition: gavl.h:212
Definition: gavl.h:2697
GAVL_PUBLIC void gavl_video_options_set_downscale_filter(gavl_video_options_t *opt, gavl_downscale_filter_t f)
Set antialiasing filter for downscaling.
GAVL_PUBLIC gavl_frame_table_t * gavl_frame_table_load(const char *filename)
Load a frame table from a file.
Green.
Definition: gavl.h:1813
GAVL_PUBLIC gavl_video_options_t * gavl_overlay_blend_context_get_options(gavl_overlay_blend_context_t *ctx)
Get options from a blend context.
GAVL_PUBLIC int gavl_audio_options_get_quality(gavl_audio_options_t *opt)
Get the quality level for a converter.
Definition: gavl.h:759
GAVL_PUBLIC int gavl_num_pixelformats()
Get total number of supported pixelformats.
GAVL_PUBLIC void gavl_video_frame_copy_plane(const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src, int plane)
Copy a single plane from one video frame to another.
#define GAVL_PIXFMT_PLANAR
Definition: gavl.h:1602
Definition: gavl.h:1761
GAVL_PUBLIC void gavl_rectangle_i_crop_left(gavl_rectangle_i_t *r, int num_pixels)
Crop an integer rectangle by some pixels from the left border.
int w
Definition: gavl.h:1289
Definition: gavl.h:246
Definition: gavl.h:2038
int samples_per_frame
Definition: gavl.h:262
GAVL_PUBLIC void gavl_audio_options_set_conversion_flags(gavl_audio_options_t *opt, int flags)
Set the conversion flags.
GAVL_PUBLIC gavl_video_converter_t * gavl_video_converter_create()
Creates a video converter.
GAVL_PUBLIC int gavl_video_frame_ssim(const gavl_video_frame_t *src1, const gavl_video_frame_t *src2, gavl_video_frame_t *dst, const gavl_video_format_t *format)
Calculate the SSIM of 2 source frames.
GAVL_PUBLIC void gavl_rectangle_i_set_all(gavl_rectangle_i_t *r, const gavl_video_format_t *format)
Let an integer rectangle span the whole image size of a video format.
GAVL_PUBLIC gavl_video_run_func gavl_video_options_get_run_func(gavl_video_options_t *opt, void **client_data)
Get function to be passed to each thread.
GAVL_PUBLIC void gavl_rectangle_i_to_f(gavl_rectangle_f_t *dst, const gavl_rectangle_i_t *src)
Convert an integer rectangle to a floating point rectangle.
GAVL_PUBLIC void gavl_video_frame_get_field(gavl_pixelformat_t pixelformat, const gavl_video_frame_t *src, gavl_video_frame_t *dst, int field)
Get a field from a frame.
GAVL_PUBLIC int gavl_frame_table_save(const gavl_frame_table_t *tab, const char *filename)
Save a frame table to a file.
GAVL_PUBLIC void gavl_video_options_set_background_color(gavl_video_options_t *opt, const float *color)
Set the background color for alpha blending.
GAVL_PUBLIC void gavl_rectangle_i_align(gavl_rectangle_i_t *r, int h_align, int v_align)
Align a rectangle.
int64_t timestamp
Definition: gavl.h:519
int64_t entries_alloc
Number of allocated entries (never touch this)
Definition: gavl.h:3653
GAVL_PUBLIC void gavl_video_frame_clear(gavl_video_frame_t *frame, const gavl_video_format_t *format)
Fill the frame with black color.
GAVL_PUBLIC void gavl_video_frame_absdiff(gavl_video_frame_t *dst, const gavl_video_frame_t *src1, const gavl_video_frame_t *src2, const gavl_video_format_t *format)
Fill the frame with the absolute differene of 2 source frames.
int64_t duration
Duration of each of these frames.
Definition: gavl.h:3658
GAVL_PUBLIC void gavl_video_frame_set_strides(gavl_video_frame_t *frame, const gavl_video_format_t *format)
Set the strides according to the format.
Definition: gavl.h:1687
GAVL_PUBLIC int gavl_video_options_get_quality(gavl_video_options_t *opt)
Get the quality level for the converter.
int64_t num_frames
Number of frames.
Definition: gavl.h:3657
#define GAVL_PIXFMT_ALPHA
Definition: gavl.h:1622
struct gavl_video_options_s gavl_video_options_t
Definition: gavl.h:2727
GAVL_PUBLIC int gavl_video_scaler_init(gavl_video_scaler_t *scaler, const gavl_video_format_t *src_format, const gavl_video_format_t *dst_format)
Initialize a video scaler.
GAVL_PUBLIC int gavl_bytes_per_sample(gavl_sample_format_t format)
Get the number of bytes per sample for a given sample format.
GAVL_PUBLIC void gavl_volume_control_set_format(gavl_volume_control_t *ctrl, const gavl_audio_format_t *format)
Set format for a volume control.
void(* gavl_video_stop_func)(void *client_data, int thread)
Wait until a piece of a calculation finished.
Definition: gavl.h:92
GAVL_PUBLIC void gavl_peak_detector_update(gavl_peak_detector_t *pd, gavl_audio_frame_t *frame)
Feed the peak detector with a new frame.
gavl_interlace_mode_t
Interlace mode.
Definition: gavl.h:2036
Definition: gavl.h:2701
Definition: gavl.h:2699
GAVL_PUBLIC void gavl_video_frame_copy_flip_y(const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src)
Copy one video frame to another with vertical flipping.
Definition: gavl.h:2658
#define GAVL_PIXFMT_GRAY
Definition: gavl.h:1627
GAVL_PUBLIC gavl_video_options_t * gavl_video_options_create()
Create an options container.
GAVL_PUBLIC gavl_video_options_t * gavl_video_converter_get_options(gavl_video_converter_t *cnv)
gets options of a video converter
Definition: gavl.h:1681
Definition: gavl.h:2007
int16_t * s_16
Definition: gavl.h:468
GAVL_PUBLIC void gavl_rectangle_f_dump(const gavl_rectangle_f_t *r)
Dump a floating point rectangle to stderr.
int64_t offset
Timestamp of the first frame.
Definition: gavl.h:3650
Definition: gavl.h:1690
GAVL_PUBLIC void gavl_video_format_copy(gavl_video_format_t *dst, const gavl_video_format_t *src)
Copy one video format to another.
Definition: gavl.h:2693
GAVL_PUBLIC int gavl_lfe_channels(const gavl_audio_format_t *format)
Get number of LFE channels for a given format.
GAVL_PUBLIC gavl_peak_detector_t * gavl_peak_detector_create()
Create peak detector.
int valid_samples
Definition: gavl.h:518
double y
Definition: gavl.h:1300
GAVL_PUBLIC int gavl_pixelformat_bits_per_pixel(gavl_pixelformat_t pixelformat)
Get the effective number of bits for one pixel.
GAVL_PUBLIC gavl_deinterlace_drop_mode_t gavl_video_options_get_deinterlace_drop_mode(gavl_video_options_t *opt)
Get the deinterlace drop mode.
gavl_framerate_mode_t framerate_mode
Definition: gavl.h:2079
gavl_audio_channels_t channels
Definition: gavl.h:517
float center_level
Definition: gavl.h:268
GAVL_PUBLIC void gavl_video_scaler_scale(gavl_video_scaler_t *scaler, const gavl_video_frame_t *input_frame, gavl_video_frame_t *output_frame)
Scale video.
Definition: gavl.h:1758
Definition: gavl.h:241
GAVL_PUBLIC void gavl_rectangle_f_crop_bottom(gavl_rectangle_f_t *r, double num_pixels)
Crop a float rectangle by some pixels from the bottom border.
Definition: gavl.h:1720
GAVL_PUBLIC float gavl_video_options_get_downscale_blur(gavl_video_options_t *opt)
Get blur factor for downscaling.
GAVL_PUBLIC gavl_deinterlace_mode_t gavl_video_options_get_deinterlace_mode(gavl_video_options_t *opt)
Get the deinterlace mode.
GAVL_PUBLIC void gavl_rectangle_f_to_i(gavl_rectangle_i_t *dst, const gavl_rectangle_f_t *src)
Convert a floating point rectangle to an integer rectangle.
Chrominance red (aka V)
Definition: gavl.h:1817
uint8_t * u_8
Definition: gavl.h:464
struct gavl_image_transform_s gavl_image_transform_t
Opaque image transformation engine.
Definition: gavl.h:3539
GAVL_PUBLIC void gavl_frame_table_append_entry(gavl_frame_table_t *t, int64_t duration)
Append an entry.
Definition: gavl.h:2657
Definition: gavl.h:224
Container for noninterleaved audio samples.
Definition: gavl.h:482
GAVL_PUBLIC int gavl_video_scaler_init_convolve(gavl_video_scaler_t *scaler, const gavl_video_format_t *format, int h_radius, const float *h_coeffs, int v_radius, const float *v_coeffs)
Initialize a video scaler as a generic convolver.
GAVL_PUBLIC void gavl_overlay_blend_context_set_overlay(gavl_overlay_blend_context_t *ctx, gavl_overlay_t *ovl)
Set a new overlay.
Definition: gavl.h:249
GAVL_PUBLIC int gavl_audio_converter_reinit(gavl_audio_converter_t *cnv)
Reinitialize an audio converter.
GAVL_PUBLIC int64_t gavl_frame_table_time_to_frame(const gavl_frame_table_t *t, int64_t time, int64_t *start_time)
Convert a timestamp to a frame index.
GAVL_PUBLIC void gavl_video_options_set_defaults(gavl_video_options_t *opt)
Set all options to their defaults.
GAVL_PUBLIC int64_t gavl_frame_table_num_frames(const gavl_frame_table_t *t)
get the total number of frames
GAVL_PUBLIC void gavl_frame_table_destroy(gavl_frame_table_t *t)
Destroy a frame table and free all memory.
gavl_interlace_mode_t interlace_mode
Definition: gavl.h:2214
GAVL_PUBLIC void gavl_video_options_set_deinterlace_mode(gavl_video_options_t *opt, gavl_deinterlace_mode_t deinterlace_mode)
Set the deinterlace mode.
GAVL_PUBLIC int gavl_audio_converter_init(gavl_audio_converter_t *cnv, const gavl_audio_format_t *input_format, const gavl_audio_format_t *output_format)
Initialize an audio converter.
GAVL_PUBLIC const char * gavl_interleave_mode_to_string(gavl_interleave_mode_t mode)
Convert a gavl_interleave_mode_t to a human readable string.
#define GAVL_PIXFMT_YUV
Definition: gavl.h:1612
#define GAVL_MAX_CHANNELS
Maximum number of audio channels.
Definition: gavl.h:196
GAVL_PUBLIC void gavl_image_transform_destroy(gavl_image_transform_t *t)
Destroy a transformation engine.
GAVL_PUBLIC void gavl_frame_table_dump(const gavl_frame_table_t *t)
Dump a frame table to stderr for debugging.
int pixel_height
Definition: gavl.h:2071
int frame_duration
Definition: gavl.h:2075
Definition: gavl.h:1717
GAVL_PUBLIC void gavl_video_format_get_chroma_offset(const gavl_video_format_t *format, int field, int plane, float *off_x, float *off_y)
Get the chroma offsets relative to the luma samples.
GAVL_PUBLIC void gavl_audio_frame_destroy(gavl_audio_frame_t *frame)
Destroy an audio frame.
Definition: gavl.h:1678
Definition: gavl.h:1684
GAVL_PUBLIC void gavl_video_frame_null(gavl_video_frame_t *frame)
Zero all pointers in the video frame.
struct gavl_video_converter_s gavl_video_converter_t
Opaque video converter structure.
Definition: gavl.h:3127
Definition: gavl.h:1670
uint64_t gavl_timecode_t
Typedef for timecodes.
Definition: timecode.h:43
int pixel_width
Definition: gavl.h:2070
int64_t pts
Timestamp of this frame.
Definition: gavl.h:3666
Definition: gavl.h:758
Definition: gavl.h:2206
GAVL_PUBLIC gavl_scale_mode_t gavl_video_options_get_scale_mode(gavl_video_options_t *opt)
Get the scale mode.
GAVL_PUBLIC void gavl_volume_control_apply(gavl_volume_control_t *ctrl, gavl_audio_frame_t *frame)
Apply a volume control for an audio frame.
Definition: gavl.h:2039
Definition: gavl.h:1754
Definition: gavl.h:1653
int frame_width
Definition: gavl.h:2062
GAVL_PUBLIC gavl_volume_control_t * gavl_volume_control_create()
Create volume control.
GAVL_PUBLIC void gavl_video_options_set_downscale_blur(gavl_video_options_t *opt, float f)
Set blur factor for downscaling.
Definition: gavl.h:242
GAVL_PUBLIC int gavl_front_channels(const gavl_audio_format_t *format)
Get number of front channels for a given format.
Definition: gavl.h:2700
Red.
Definition: gavl.h:1812
Definition: gavl.h:2670
double x
Definition: gavl.h:1299
GAVL_PUBLIC void gavl_audio_options_copy(gavl_audio_options_t *dst, const gavl_audio_options_t *src)
Copy audio options.
GAVL_PUBLIC gavl_frame_table_t * gavl_frame_table_create_cfr(int64_t offset, int64_t frame_duration, int64_t num_frames, gavl_timecode_t start_timecode)
Create a frame table for constant framerate video.
Definition: gavl.h:239
GAVL_PUBLIC void gavl_rectangle_i_crop_right(gavl_rectangle_i_t *r, int num_pixels)
Crop an integer rectangle by some pixels from the right border.
GAVL_PUBLIC const char * gavl_interlace_mode_to_string(gavl_interlace_mode_t mode)
Translate an interlace mode into a human readable string.
GAVL_PUBLIC void gavl_video_frame_copy_metadata(gavl_video_frame_t *dst, const gavl_video_frame_t *src)
Copy metadata of one video frame to another.
GAVL_PUBLIC void gavl_video_frame_copy_flip_xy(const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src)
Copy one video frame to another with horizontal and vertical flipping.
GAVL_PUBLIC int gavl_video_frame_insert_channel(const gavl_video_format_t *format, gavl_color_channel_t ch, const gavl_video_frame_t *src, gavl_video_frame_t *dst)
Insert one channel from a grayscale image into a video frame.
Definition: gavl.h:207
Definition: gavl.h:2698
Definition: gavl.h:1751
Definition: gavl.h:1649
int x
Definition: gavl.h:1287
GAVL_PUBLIC void gavl_video_converter_destroy(gavl_video_converter_t *cnv)
Destroys a video converter and frees all associated memory.
Definition: gavl.h:245
GAVL_PUBLIC gavl_video_options_t * gavl_image_transform_get_options(gavl_image_transform_t *t)
Get transformation options.
GAVL_PUBLIC void gavl_audio_frame_copy_ptrs(const gavl_audio_format_t *format, gavl_audio_frame_t *dst, const gavl_audio_frame_t *src)
Copy audio data from one frame to another.
Widen the filter curve according to the scaling ratio.
Definition: gavl.h:2717
int samplerate
Definition: gavl.h:263
gavl_interleave_mode_t interleave_mode
Definition: gavl.h:266
float * f
Definition: gavl.h:473
Definition: gavl.h:1285
GAVL_PUBLIC void gavl_audio_converter_destroy(gavl_audio_converter_t *cnv)
Destroys an audio converter and frees all associated memory.
GAVL_PUBLIC int gavl_rectangle_f_is_empty(const gavl_rectangle_f_t *r)
Check if a float rectangle is empty.
gavl_sample_format_t
Format of one audio sample.
Definition: gavl.h:204
GAVL_PUBLIC void gavl_rectangle_i_copy(gavl_rectangle_i_t *dst, const gavl_rectangle_i_t *src)
Copy an integer rectangle.
GAVL_PUBLIC void gavl_rectangle_f_crop_top(gavl_rectangle_f_t *r, double num_pixels)
Crop a float rectangle by some pixels from the top border.
GAVL_PUBLIC void gavl_peak_detector_destroy(gavl_peak_detector_t *pd)
Destroys a peak detector and frees all associated memory.
GAVL_PUBLIC void gavl_audio_frame_get_subframe(const gavl_audio_format_t *format, gavl_audio_frame_t *src, gavl_audio_frame_t *dst, int start, int len)
Set an audio frame to a subframe of another frame.
GAVL_PUBLIC gavl_overlay_blend_context_t * gavl_overlay_blend_context_create()
Create a blend context.
gavl_chroma_placement_t
Chroma placement.
Definition: gavl.h:2005
gavl_chroma_placement_t chroma_placement
Definition: gavl.h:2080
GAVL_PUBLIC void gavl_video_scaler_destroy(gavl_video_scaler_t *scaler)
Destroy a video scaler.
Definition: gavl.h:1704
GAVL_PUBLIC void gavl_rectangle_i_crop_bottom(gavl_rectangle_i_t *r, int num_pixels)
Crop an integer rectangle by some pixels from the bottom border.
Definition: gavl.h:2672
GAVL_PUBLIC int gavl_video_format_get_image_size(const gavl_video_format_t *format)
Get the unpadded image size.
gavl_audio_dither_mode_t
Dither mode.
Definition: gavl.h:740
#define GAVL_PIXFMT_RGB
Definition: gavl.h:1607
float rear_level
Definition: gavl.h:269
Definition: gavl.h:1707
GAVL_PUBLIC int gavl_video_options_get_conversion_flags(gavl_video_options_t *opt)
Get the conversion flags.
GAVL_PUBLIC int gavl_pixelformat_conversion_penalty(gavl_pixelformat_t src, gavl_pixelformat_t dst)
Get the conversion penalty for pixelformat conversions.
double * d
Definition: gavl.h:474
Undefined.
Definition: gavl.h:1637
Definition: gavl.h:247
GAVL_PUBLIC int64_t gavl_frame_table_frame_to_time(const gavl_frame_table_t *t, int64_t frame, int *duration)
Convert a frame index to a timestamp.
GAVL_PUBLIC gavl_frame_table_t * gavl_frame_table_create()
Create a frame table.
Definition: gavl.h:1732
Do a Gaussian preblur.
Definition: gavl.h:2718
Definition: gavl.h:2695
GAVL_PUBLIC int gavl_aux_channels(const gavl_audio_format_t *format)
Get number of aux channels for a given format.
GAVL_PUBLIC int gavl_video_frame_extract_channel(const gavl_video_format_t *format, gavl_color_channel_t ch, const gavl_video_frame_t *src, gavl_video_frame_t *dst)
Extract one channel of a video frame into a grayscale image.
GAVL_PUBLIC gavl_frame_table_t * gavl_frame_table_copy(const gavl_frame_table_t *tab)
Copy a frame table to another.
Definition: gavl.h:1697
Definition: gavl.h:243
gavl_timecode_t timecode
Definition: gavl.h:2215
GAVL_PUBLIC int gavl_pixelformat_bytes_per_pixel(gavl_pixelformat_t pixelformat)
Get bytes per pixel for packed formats.
GAVL_PUBLIC int gavl_video_converter_reinit(gavl_video_converter_t *cnv)
Reinitialize a video converter.
GAVL_PUBLIC void gavl_rectangle_f_copy(gavl_rectangle_f_t *dst, const gavl_rectangle_f_t *src)
Copy a float rectangle.
Overlay structure.
Definition: gavl.h:3434
GAVL_PUBLIC gavl_pixelformat_t gavl_get_pixelformat(int index)
Get the pixelformat from index.
gavl_deinterlace_mode_t
Definition: gavl.h:2667
GAVL_PUBLIC void gavl_audio_options_set_quality(gavl_audio_options_t *opt, int quality)
Set the quality level for the converter.
GAVL_PUBLIC void gavl_rectangle_f_crop_to_format(gavl_rectangle_f_t *r, const gavl_video_format_t *format)
Crop a floating point rectangle so it fits into the image size of a video format. ...
GAVL_PUBLIC void gavl_rectangle_f_set_all(gavl_rectangle_f_t *r, const gavl_video_format_t *format)
Let a float rectangle span the whole image size of a video format.
GAVL_PUBLIC int gavl_image_transform_init(gavl_image_transform_t *t, gavl_video_format_t *format, gavl_image_transform_func func, void *priv)
Initialize a transformation engine.
GAVL_PUBLIC const char * gavl_sample_format_to_string(gavl_sample_format_t format)
Convert a gavl_sample_format_t to a human readable string.
Definition: gavl.h:2671
Definition: gavl.h:2683
Definition: gavl.h:1645
Definition: gavl.h:1711
GAVL_PUBLIC int gavl_side_channels(const gavl_audio_format_t *format)
Get number of side channels for a given format.
Definition: gavl.h:209
GAVL_PUBLIC void gavl_video_frame_destroy(gavl_video_frame_t *frame)
Destroy a video frame.
GAVL_PUBLIC gavl_audio_options_t * gavl_audio_converter_get_options(gavl_audio_converter_t *cnv)
gets options of an audio converter
GAVL_PUBLIC void gavl_audio_options_destroy(gavl_audio_options_t *opt)
Destroy audio options.
Definition: gavl.h:755
GAVL_PUBLIC gavl_image_transform_t * gavl_image_transform_create()
Create a transformation engine.
gavl_video_frame_t * frame
Video frame in an alpha capable format */.
Definition: gavl.h:3436
GAVL_PUBLIC void gavl_overlay_blend(gavl_overlay_blend_context_t *ctx, gavl_video_frame_t *dst_frame)
Blend overlay onto video frame.
Definition: gavl.h:2008
GAVL_PUBLIC int gavl_audio_converter_init_resample(gavl_audio_converter_t *cnv, const gavl_audio_format_t *format)
Initialize an audio converter just for resampling.
Definition: gavl.h:2027
GAVL_PUBLIC int gavl_video_converter_init(gavl_video_converter_t *cnv, const gavl_video_format_t *input_format, const gavl_video_format_t *output_format)
Initialize a video converter.
struct gavl_video_deinterlacer_s gavl_video_deinterlacer_t
Opaque deinterlacer structure.
Definition: gavl.h:3343
GAVL_PUBLIC void gavl_video_frame_set_planes(gavl_video_frame_t *frame, const gavl_video_format_t *format, uint8_t *buffer)
Set the frames according to the format.
Blue.
Definition: gavl.h:1814
Definition: gavl.h:1297
struct gavl_overlay_blend_context_s gavl_overlay_blend_context_t
Opaque blend context.
Definition: gavl.h:3448
Definition: gavl.h:2009
Definition: gavl.h:213
GAVL_PUBLIC void gavl_video_frame_get_subframe(gavl_pixelformat_t pixelformat, const gavl_video_frame_t *src, gavl_video_frame_t *dst, gavl_rectangle_i_t *src_rect)
Get a subframe of another frame.
Container for interleaved audio samples.
Definition: gavl.h:462
Definition: gavl.h:1661
GAVL_PUBLIC void gavl_overlay_blend_context_destroy(gavl_overlay_blend_context_t *ctx)
Destroy a blend context and free all associated memory.
int64_t duration
Definition: gavl.h:2213
GAVL_PUBLIC void gavl_video_frame_fill(gavl_video_frame_t *frame, const gavl_video_format_t *format, const float *color)
Fill the frame with a user spefified color.
GAVL_PUBLIC gavl_video_frame_t * gavl_video_frame_create_nopad(const gavl_video_format_t *format)
Create video frame without padding.
gavl_framerate_mode_t
Framerate mode.
Definition: gavl.h:2025
int h
Definition: gavl.h:1290
Definition: gavl.h:1735
Definition: gavl.h:208
GAVL_PUBLIC gavl_video_scaler_t * gavl_video_scaler_create()
Create a video scaler.
GAVL_PUBLIC void gavl_rectangle_f_crop_right(gavl_rectangle_f_t *r, double num_pixels)
Crop a float rectangle by some pixels from the right border.
GAVL_PUBLIC void gavl_audio_format_copy(gavl_audio_format_t *dst, const gavl_audio_format_t *src)
Copy one audio format to another.
GAVL_PUBLIC void gavl_video_options_set_alpha_mode(gavl_video_options_t *opt, gavl_alpha_mode_t alpha_mode)
Set the alpha mode.
#define GAVL_PIXFMT_YUVJ
Definition: gavl.h:1617
Definition: gavl.h:2684
uint32_t * u_32
Definition: gavl.h:470
#define GAVL_MAX_PLANES
Definition: gavl.h:1273
gavl_resample_mode_t
Resample mode.
Definition: gavl.h:753
gavl_interleave_mode_t
Definition: gavl.h:221
Definition: gavl.h:1700
Definition: gavl.h:211
GAVL_PUBLIC void gavl_rectangle_f_crop_left(gavl_rectangle_f_t *r, double num_pixels)
Crop a float rectangle by some pixels from the left border.
GAVL_PUBLIC void gavl_image_transform_transform(gavl_image_transform_t *t, gavl_video_frame_t *in_frame, gavl_video_frame_t *out_frame)
Transform an image.
GAVL_PUBLIC void gavl_video_deinterlacer_deinterlace(gavl_video_deinterlacer_t *deinterlacer, const gavl_video_frame_t *input_frame, gavl_video_frame_t *output_frame)
Deinterlace video.
int y
Definition: gavl.h:1288
GAVL_PUBLIC gavl_video_deinterlacer_t * gavl_video_deinterlacer_create()
Create a video deinterlacer.
int image_height
Definition: gavl.h:2066
Definition: gavl.h:2028
Definition: gavl.h:210
GAVL_PUBLIC gavl_audio_dither_mode_t gavl_audio_options_get_dither_mode(gavl_audio_options_t *opt)
Get the dither mode for the converter.
GAVL_PUBLIC int gavl_audio_options_get_conversion_flags(gavl_audio_options_t *opt)
Get the conversion flags.
GAVL_PUBLIC void gavl_video_options_set_num_threads(gavl_video_options_t *opt, int n)
Set number of threads.
GAVL_PUBLIC int64_t gavl_frame_table_end_time(const gavl_frame_table_t *t)
get the end time of the last frame
Definition: gavl.h:1744
GAVL_PUBLIC void gavl_audio_frame_mute_samples(gavl_audio_frame_t *frame, const gavl_audio_format_t *format, int num_samples)
Mute a number of samples at the start of an audio frame.
GAVL_PUBLIC gavl_pixelformat_t gavl_pixelformat_get_best(gavl_pixelformat_t src, const gavl_pixelformat_t *dst_supported, int *penalty)
Get the best destination format for a given source format.
Definition: gavl.h:238
GAVL_PUBLIC int gavl_video_formats_equal(const gavl_video_format_t *format_1, const gavl_video_format_t *format_2)
Compare 2 video formats.
Definition: gavl.h:237
GAVL_PUBLIC void gavl_audio_options_set_defaults(gavl_audio_options_t *opt)
Set all options to their defaults.
GAVL_PUBLIC void gavl_audio_format_dump(const gavl_audio_format_t *format)
Dump an audio format to stderr.
GAVL_PUBLIC int gavl_video_options_get_num_threads(gavl_video_options_t *opt)
Set number of threads.
gavl_interlace_mode_t interlace_mode
Definition: gavl.h:2082
struct gavl_audio_converter_s gavl_audio_converter_t
Opaque audio converter structure.
Definition: gavl.h:951
gavl_timecode_format_t timecode_format
Definition: gavl.h:2084
GAVL_PUBLIC const char * gavl_pixelformat_to_string(gavl_pixelformat_t pixelformat)
Translate a pixelformat into a human readable string.
Definition: gavl.h:1657
int image_width
Definition: gavl.h:2065
Chrominance blue (aka U)
Definition: gavl.h:1816
GAVL_PUBLIC void gavl_video_options_set_run_func(gavl_video_options_t *opt, gavl_video_run_func func, void *client_data)
Set function to be passed to each thread.
gavl_sample_format_t sample_format
Definition: gavl.h:265
int frame_height
Definition: gavl.h:2063
GAVL_PUBLIC void gavl_video_options_set_rectangles(gavl_video_options_t *opt, const gavl_rectangle_f_t *src_rect, const gavl_rectangle_i_t *dst_rect)
Set source and destination rectangles.
int channel_stride
Definition: gavl.h:520
GAVL_PUBLIC void gavl_rectangle_crop_to_format_scale(gavl_rectangle_f_t *src_rect, gavl_rectangle_i_t *dst_rect, const gavl_video_format_t *src_format, const gavl_video_format_t *dst_format)
Crop 2 rectangles to their formats when scaling is available.
GAVL_PUBLIC void gavl_frame_table_append_timecode(gavl_frame_table_t *t, int64_t pts, gavl_timecode_t tc)
Append a timecodes.
GAVL_PUBLIC gavl_downscale_filter_t gavl_video_options_get_downscale_filter(gavl_video_options_t *opt)
Get the antialiasing filter for downscaling.
GAVL_PUBLIC void gavl_rectangle_i_crop_top(gavl_rectangle_i_t *r, int num_pixels)
Crop an integer rectangle by some pixels from the top border.
GAVL_PUBLIC gavl_audio_converter_t * gavl_audio_converter_create()
Creates an audio converter.
Definition: gavl.h:2669
GAVL_PUBLIC gavl_video_options_t * gavl_video_deinterlacer_get_options(gavl_video_deinterlacer_t *deinterlacer)
gets options of a deinterlacer
Definition: gavl.h:2696
GAVL_PUBLIC void gavl_video_convert(gavl_video_converter_t *cnv, const gavl_video_frame_t *input_frame, gavl_video_frame_t *output_frame)
Convert video.
GAVL_PUBLIC int gavl_channel_index(const gavl_audio_format_t *format, gavl_channel_id_t id)
Get the index of a particular channel for a given format.
GAVL_PUBLIC const double ** gavl_audio_options_get_mix_matrix(gavl_audio_options_t *opt)
Get the mix matrix.
GAVL_PUBLIC void gavl_video_options_get_rectangles(gavl_video_options_t *opt, gavl_rectangle_f_t *src_rect, gavl_rectangle_i_t *dst_rect)
Get source and destination rectangles.
Audio Format.
Definition: gavl.h:260
frame table structure
Definition: gavl.h:3648
GAVL_PUBLIC void gavl_audio_frame_mute(gavl_audio_frame_t *frame, const gavl_audio_format_t *format)
Mute an audio frame.
GAVL_PUBLIC void gavl_audio_options_set_resample_mode(gavl_audio_options_t *opt, gavl_resample_mode_t mode)
Set the resample mode for the converter.
Definition: gavl.h:1727
GAVL_PUBLIC void gavl_rectangle_fit_aspect(gavl_rectangle_i_t *dst_rect, const gavl_video_format_t *src_format, const gavl_rectangle_f_t *src_rect, const gavl_video_format_t *dst_format, float zoom, float squeeze)
Calculate a destination rectangle for scaling.
Definition: gavl.h:2694
int64_t num_entries
Number of entries.
Definition: gavl.h:3652
GAVL_PUBLIC gavl_video_frame_t * gavl_video_frame_create(const gavl_video_format_t *format)
Create video frame.
GAVL_PUBLIC void gavl_video_frame_psnr(double *psnr, const gavl_video_frame_t *src1, const gavl_video_frame_t *src2, const gavl_video_format_t *format)
Calculate the PSNR of 2 source frames.
Definition: gavl.h:2040
GAVL_PUBLIC void gavl_video_options_set_deinterlace_drop_mode(gavl_video_options_t *opt, gavl_deinterlace_drop_mode_t deinterlace_drop_mode)
Set the deinterlace drop mode.
GAVL_PUBLIC int gavl_pixelformat_num_planes(gavl_pixelformat_t pixelformat)
Get the number of planes.
Definition: gavl.h:760
GAVL_PUBLIC int gavl_accel_supported()
Get the supported acceleration flags.
Definition: gavl.h:1674
GAVL_PUBLIC int gavl_video_deinterlacer_init(gavl_video_deinterlacer_t *deinterlacer, const gavl_video_format_t *src_format)
Initialize a video deinterlacer.
GAVL_PUBLIC void gavl_audio_options_set_dither_mode(gavl_audio_options_t *opt, gavl_audio_dither_mode_t mode)
Set the dither mode for the converter.
GAVL_PUBLIC int64_t gavl_frame_table_duration(const gavl_frame_table_t *t)
get the total duration of all frames
gavl_pixelformat_t pixelformat
Definition: gavl.h:2073
GAVL_PUBLIC int gavl_audio_frame_copy(const gavl_audio_format_t *format, gavl_audio_frame_t *dst, const gavl_audio_frame_t *src, int dst_pos, int src_pos, int dst_size, int src_size)
Copy audio data from one frame to another.
int timecodes_alloc
Number of allocated timecodes (never touch this)
Definition: gavl.h:3662
GAVL_PUBLIC int gavl_overlay_blend_context_init(gavl_overlay_blend_context_t *ctx, const gavl_video_format_t *frame_format, gavl_video_format_t *overlay_format)
Initialize the blend context.
Fastest method, might produce heavy aliasing artifacts.
Definition: gavl.h:2716
GAVL_PUBLIC void gavl_rectangle_i_align_to_format(gavl_rectangle_i_t *r, const gavl_video_format_t *format)
Align a rectangle to a format.
Definition: gavl.h:1738
struct gavl_video_scaler_s gavl_video_scaler_t
Opaque scaler structure.
Definition: gavl.h:3243
gavl_deinterlace_drop_mode_t
Specifies which field to drop when deinterlacing.
Definition: gavl.h:2681
GAVL_PUBLIC void gavl_rectangle_i_dump(const gavl_rectangle_i_t *r)
Dump a rectangle to stderr.
GAVL_PUBLIC void gavl_audio_options_set_mix_matrix(gavl_audio_options_t *opt, const double **matrix)
Set a user defined mix matrix.
Definition: gavl.h:1723
Definition: gavl.h:756
GAVL_PUBLIC void gavl_audio_frame_mute_channel(gavl_audio_frame_t *frame, const gavl_audio_format_t *format, int channel)
Mute a single channel of an audio frame.
Definition: gavl.h:248
Transparency (or, to be more precise opacity)
Definition: gavl.h:1818
gavl_rectangle_i_t ovl_rect
Rectangle in the source frame */.
Definition: gavl.h:3437
int timescale
Definition: gavl.h:2077
Auto selection based on quality.
Definition: gavl.h:2715
GAVL_PUBLIC void gavl_video_format_dump(const gavl_video_format_t *format)
Dump a video format to stderr.
GAVL_PUBLIC int gavl_get_color_channel_format(const gavl_video_format_t *frame_format, gavl_video_format_t *channel_format, gavl_color_channel_t ch)
Get the video format for extracting/merging one channel.
Definition: gavl.h:1693
GAVL_PUBLIC gavl_timecode_t gavl_frame_table_time_to_timecode(const gavl_frame_table_t *t, int64_t time, int64_t *start_time, const gavl_timecode_format_t *fmt)
Convert a timestamp to a timecode.
GAVL_PUBLIC void gavl_video_options_copy(gavl_video_options_t *dst, const gavl_video_options_t *src)
Copy video options.
GAVL_PUBLIC void gavl_video_frame_dump(gavl_video_frame_t *frame, const gavl_video_format_t *format, const char *namebase)
Dump a video frame to files.
struct gavl_peak_detector_s gavl_peak_detector_t
Opaque structure for peak detector.
Definition: gavl.h:1179
GAVL_PUBLIC void gavl_peak_detector_reset(gavl_peak_detector_t *pd)
Reset a peak detector.
Video format.
Definition: gavl.h:2060
GAVL_PUBLIC void gavl_video_options_set_quality(gavl_video_options_t *opt, int quality)
Set the quality level for the converter.
Definition: gavl.h:757
int8_t * s_8
Definition: gavl.h:465
GAVL_PUBLIC int gavl_audio_converter_set_resample_ratio(gavl_audio_converter_t *cnv, double ratio)
Set samplerate converstion ratio.
gavl_color_channel_t
Color channel definitions.
Definition: gavl.h:1810
GAVL_PUBLIC gavl_timecode_t gavl_frame_table_frame_to_timecode(const gavl_frame_table_t *t, int64_t frame, int64_t *start_time, const gavl_timecode_format_t *fmt)
Convert a frame index to a timecode.
GAVL_PUBLIC gavl_resample_mode_t gavl_audio_options_get_resample_mode(gavl_audio_options_t *opt)
Get the resample mode for the converter.
int num_channels
Definition: gavl.h:264
Definition: gavl.h:240
Luminance (also grayscale)
Definition: gavl.h:1815
Definition: gavl.h:1714
int num_timecodes
Number of timecodes.
Definition: gavl.h:3661
Definition: gavl.h:2029
GAVL_PUBLIC gavl_frame_table_t * gavl_frame_table_create_audio(int samplerate, int64_t offset, int64_t duration, gavl_timecode_format_t *fmt_ret)
Create a frame table for an audio stream.
int dst_x
x offset in the destination frame. */
Definition: gavl.h:3438
GAVL_PUBLIC void gavl_video_options_set_scale_order(gavl_video_options_t *opt, int order)
Set the scale order for GAVL_SCALE_SINC_LANCZOS.
GAVL_PUBLIC gavl_alpha_mode_t gavl_video_options_get_alpha_mode(gavl_video_options_t *opt)
Get the alpha mode.
GAVL_PUBLIC gavl_video_stop_func gavl_video_options_get_stop_func(gavl_video_options_t *opt, void **client_data)
Get function to be passed to each thread.
Definition: gavl.h:2041
GAVL_PUBLIC void gavl_video_options_set_stop_func(gavl_video_options_t *opt, gavl_video_stop_func func, void *client_data)
Set function to be passed to each thread.
Definition: gavl.h:1748
Definition: gavl.h:206
Definition: gavl.h:223
GAVL_PUBLIC void gavl_peak_detector_get_peak(gavl_peak_detector_t *pd, double *min, double *max, double *abs)
Get the peak volume across all channels.
double w
Definition: gavl.h:1301
int64_t timestamp
Definition: gavl.h:2212
GAVL_PUBLIC void gavl_audio_converter_resample(gavl_audio_converter_t *cnv, gavl_audio_frame_t *input_frame, gavl_audio_frame_t *output_frame, double ratio)
Convert audio.
GAVL_PUBLIC void gavl_peak_detector_set_format(gavl_peak_detector_t *pd, const gavl_audio_format_t *format)
Set format for a peak detector.
GAVL_PUBLIC void gavl_video_options_destroy(gavl_video_options_t *opt)
Destroy video options.
GAVL_PUBLIC void gavl_video_options_set_conversion_flags(gavl_video_options_t *opt, int conversion_flags)
Set the conversion flags.