MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / hb_frame_buffer_init

Function hb_frame_buffer_init

libhb/fifo.c:839–881  ·  view source on GitHub ↗

this routine gets a buffer for an uncompressed picture with pixel format pix_fmt and dimensions width x height.

Source from the content-addressed store, hash-verified

837// this routine gets a buffer for an uncompressed picture
838// with pixel format pix_fmt and dimensions width x height.
839hb_buffer_t * hb_frame_buffer_init( int pix_fmt, int width, int height )
840{
841 const AVPixFmtDescriptor * desc = av_pix_fmt_desc_get(pix_fmt);
842 hb_buffer_t * buf;
843 uint8_t has_plane[4] = {0,};
844 int ii, pp, max_plane = 0;
845
846 if (desc == NULL)
847 {
848 return NULL;
849 }
850
851 int size = 0;
852 for (ii = 0; ii < desc->nb_components; ii++)
853 {
854 pp = desc->comp[ii].plane;
855 if (pp > max_plane)
856 {
857 max_plane = pp;
858 }
859 if (!has_plane[pp])
860 {
861 has_plane[pp] = 1;
862 size += hb_image_stride( pix_fmt, width, pp ) *
863 hb_image_height( pix_fmt, height, pp );
864 }
865 }
866
867 buf = hb_buffer_init_internal(size);
868
869 if( buf == NULL )
870 return NULL;
871
872 buf->f.max_plane = max_plane;
873 buf->s.type = FRAME_BUF;
874 buf->f.width = width;
875 buf->f.height = height;
876 buf->f.fmt = pix_fmt;
877
878 hb_buffer_init_planes(buf);
879
880 return buf;
881}
882
883void hb_frame_buffer_blank_stride(hb_buffer_t * buf)
884{

Callers 15

hb_read_previewFunction · 0.85
scale_subtitleFunction · 0.85
compose_subsample_assFunction · 0.85
CreateBlackBufFunction · 0.85
comb_detect_initFunction · 0.85
hb_decomb_initFunction · 0.85
process_frameFunction · 0.85
nlmeans_filter_workFunction · 0.85
nlmeans_filter_flushFunction · 0.85
decavsubWorkFunction · 0.85

Calls 4

hb_image_strideFunction · 0.85
hb_image_heightFunction · 0.85
hb_buffer_init_internalFunction · 0.85
hb_buffer_init_planesFunction · 0.85

Tested by

no test coverage detected