MCPcopy Create free account
hub / github.com/apache/nuttx / openh264_decoder_dequeue

Function openh264_decoder_dequeue

arch/sim/src/sim/sim_openh264dec.c:171–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171int openh264_decoder_dequeue(struct openh264_decoder_s *decoder,
172 void *data, int64_t *pts, uint32_t *size)
173{
174 uint8_t *dst_addr = data;
175 int plane;
176
177 for (plane = 0; plane < 3; plane++)
178 {
179 uint8_t *src_addr = decoder->pdst[plane];
180 int width = decoder->bufinfo.UsrData.sSystemBuffer.iWidth;
181 int height = decoder->bufinfo.UsrData.sSystemBuffer.iHeight;
182 int stride = decoder->bufinfo.UsrData.sSystemBuffer.iStride[0];
183 int row;
184
185 if (plane > 0)
186 {
187 /* UV plane stride is iStride[1] */
188
189 width = width / 2;
190 height = height / 2;
191 stride = decoder->bufinfo.UsrData.sSystemBuffer.iStride[1];
192 }
193
194 for (row = 0; row < height; row++)
195 {
196 memcpy(dst_addr, src_addr, width);
197 src_addr += stride;
198 dst_addr += width;
199 }
200 }
201
202 *pts = decoder->bufinfo.uiOutYuvTimeStamp;
203 *size = decoder->bufinfo.UsrData.sSystemBuffer.iWidth *
204 decoder->bufinfo.UsrData.sSystemBuffer.iHeight * 3 / 2;
205
206 return decoder->remaining_frames;
207}
208

Callers 1

sim_decoder_processFunction · 0.85

Calls 1

memcpyFunction · 0.50

Tested by

no test coverage detected