FastLED 3.9.15
Loading...
Searching...
No Matches

◆ plm_video_decode_picture()

void fl::third_party::plm_video_decode_picture ( plm_video_t * self)

Definition at line 2382 of file pl_mpeg.hpp.

2382 {
2383 plm_buffer_skip(self->buffer, 10); // skip temporalReference
2384 self->picture_type = plm_buffer_read(self->buffer, 3);
2385 plm_buffer_skip(self->buffer, 16); // skip vbv_delay
2386
2387 // D frames or unknown coding type
2388 if (self->picture_type <= 0 || self->picture_type > PLM_VIDEO_PICTURE_TYPE_B) {
2389 return;
2390 }
2391
2392 // Forward full_px, f_code
2393 if (
2396 ) {
2397 self->motion_forward.full_px = plm_buffer_read(self->buffer, 1);
2398 int f_code = plm_buffer_read(self->buffer, 3);
2399 if (f_code == 0) {
2400 // Ignore picture with zero f_code
2401 return;
2402 }
2403 self->motion_forward.r_size = f_code - 1;
2404 }
2405
2406 // Backward full_px, f_code
2409 int f_code = plm_buffer_read(self->buffer, 3);
2410 if (f_code == 0) {
2411 // Ignore picture with zero f_code
2412 return;
2413 }
2414 self->motion_backward.r_size = f_code - 1;
2415 }
2416
2417 plm_frame_t frame_temp = self->frame_forward;
2418 if (
2421 ) {
2422 self->frame_forward = self->frame_backward;
2423 }
2424
2425
2426 // Find first slice start code; skip extension and user data
2427 do {
2429 } while (
2430 self->start_code == PLM_START_EXTENSION ||
2432 );
2433
2434 // Decode all slices
2435 while (PLM_START_IS_SLICE(self->start_code)) {
2436 plm_video_decode_slice(self, self->start_code & 0x000000FF);
2437 if (self->macroblock_address >= self->mb_size - 2) {
2438 break;
2439 }
2441 }
2442
2443 // If this is a reference picture rotate the prediction pointers
2444 if (
2447 ) {
2448 self->frame_backward = self->frame_current;
2449 self->frame_current = frame_temp;
2450 }
2451}
int plm_buffer_read(plm_buffer_t *self, int count) FL_NOEXCEPT
Definition pl_mpeg.hpp:1017
static const int PLM_VIDEO_PICTURE_TYPE_B
Definition pl_mpeg.hpp:1632
static const int PLM_VIDEO_PICTURE_TYPE_PREDICTIVE
Definition pl_mpeg.hpp:1631
int plm_buffer_next_start_code(plm_buffer_t *self) FL_NOEXCEPT
Definition pl_mpeg.hpp:1060
static const int PLM_START_USER_DATA
Definition pl_mpeg.hpp:1639
static const int PLM_VIDEO_PICTURE_TYPE_INTRA
Definition pl_mpeg.hpp:1630
void plm_buffer_skip(plm_buffer_t *self, size_t count) FL_NOEXCEPT
Definition pl_mpeg.hpp:1044
void plm_video_decode_slice(plm_video_t *self, int slice) FL_NOEXCEPT
Definition pl_mpeg.hpp:2453
static const int PLM_START_EXTENSION
Definition pl_mpeg.hpp:1638
plm_video_motion_t motion_backward
Definition pl_mpeg.hpp:2064
plm_video_motion_t motion_forward
Definition pl_mpeg.hpp:2063
#define PLM_START_IS_SLICE(c)
Definition pl_mpeg.hpp:1641

References FL_NOEXCEPT, plm_buffer_next_start_code(), plm_buffer_read(), plm_buffer_skip(), PLM_START_EXTENSION, PLM_START_IS_SLICE, PLM_START_USER_DATA, plm_video_decode_slice(), PLM_VIDEO_PICTURE_TYPE_B, PLM_VIDEO_PICTURE_TYPE_INTRA, and PLM_VIDEO_PICTURE_TYPE_PREDICTIVE.

Referenced by plm_video_decode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: