/***************************************************************************** * jpeg2000.h J2K definitions ***************************************************************************** * Copyright (C) 2017 VideoLAN Authors * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #ifndef VLC_JPEG2000_H #define VLC_JPEG2000_H #define J2K_BOX_JP2C VLC_FOURCC('j','p','2','c') enum j2k_profiles_e { J2K_PROFILE_SD = 0, J2K_PROFILE_HD, J2K_PROFILE_3G, J2K_PROFILE_S3D_HD, J2K_PROFILE_S3D_3G, }; static inline bool j2k_is_valid_framerate( unsigned num, unsigned den ) { const struct { const unsigned num; const unsigned den; } numdens[] = { /* table 2-99 */ { 24000, 1001 }, { 24, 1 }, { 25, 1 }, { 30000, 1001 }, { 30, 1 }, { 50, 1 }, { 60000, 1001 }, { 60, 1 }, }; for( size_t i=0; i J2K_COLOR_SPEC_UNKNOWN && e <= J2K_COLOR_SPEC_SMPTE_2084 ) { *primaries = j2k_color_specifications[e].primaries; *transfer = j2k_color_specifications[e].transfer; *space = j2k_color_specifications[e].space; } } static inline enum j2k_color_specs_e j2k_get_color_spec( video_color_primaries_t primaries, video_transfer_func_t transfer , video_color_space_t space ) { enum j2k_color_specs_e e; for( e = J2K_COLOR_SPEC_UNKNOWN; e <= J2K_COLOR_SPEC_SMPTE_2084; e++ ) { if( primaries == j2k_color_specifications[e].primaries && transfer == j2k_color_specifications[e].transfer && space == j2k_color_specifications[e].space ) { return e; } } return J2K_COLOR_SPEC_UNKNOWN; } #endif