MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / get_buffer_size_by_format

Function get_buffer_size_by_format

ps3fw/cellCamera.cpp:341–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339}
340
341u32 get_buffer_size_by_format(s32 format, s32 width, s32 height)
342{
343 double bytes_per_pixel = 0.0;
344 switch (format)
345 {
346 case CELL_CAMERA_RAW8:
347 bytes_per_pixel = 1.0;
348 break;
349 case CELL_CAMERA_YUV422:
350 bytes_per_pixel = 2.0;
351 break;
352 case CELL_CAMERA_YUV420:
353 case CELL_CAMERA_V_Y1_U_Y0:
354 bytes_per_pixel = 1.5;
355 break;
356 case CELL_CAMERA_RAW10:
357 bytes_per_pixel = 1.25;
358 break;
359 case CELL_CAMERA_JPG:
360 case CELL_CAMERA_RGBA:
361 case CELL_CAMERA_FORMAT_UNKNOWN:
362 default:
363 bytes_per_pixel = 4.0;
364 break;
365 }
366
367 return ::narrow<u32>(static_cast<u64>(std::ceil(width * height * bytes_per_pixel)));
368}
369
370u32 get_video_buffer_size(const CellCameraInfoEx& info)
371{

Callers 3

get_video_buffer_sizeFunction · 0.85
convert_image_formatFunction · 0.85
set_imageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected