Hi, Am 16.02.2011 02:27, schrieb Romain Beauxis: [...] > > Thanks for the details! Does the following transcribes it ? > > static inline int gavl_video_frame_is_aligned(gavl_video_frame_t *vf, int > planes) > { > int i; > > for (i = 0; i< planes; i++) > { > if (((long)vf->planes[i] % ALIGNMENT_BYTES != 0)) > return 0; > if (((long)vf->strides[i] % ALIGNMENT_BYTES != 0)) > return 0; > } > > return 1; > }
Well ALIGNMENT_BYTES is only defined in a .c file, and a static inline function there wouldn't be callable from outside. Currently gavl has no inline functions. Also the planes argument should be avoided. Either one passes a gavl_video_format_t or a gavl_pixelformat_t, that's more consistent with the rest of the API. Or one uses simply GAVL_MAX_PLANES (currently 4 but just 3 are used by the defined pixelformats). If planes is smaller than 4, the upper array members are zero, and 0 % ALIGNMENT_BYTES is always 0. Also, vf->strides[i] doesn't need to be cast to long. Burkhard ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Gmerlin-general mailing list Gmerlin-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gmerlin-general