| 339 | } |
| 340 | |
| 341 | u32 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 | |
| 370 | u32 get_video_buffer_size(const CellCameraInfoEx& info) |
| 371 | { |
no outgoing calls
no test coverage detected