Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The data array is not an array of 8 uint_8 but rather an array of 8 <strong>pointers</strong> to uint_8. Note the asterik before the data. - The type is uint8_t* - that is <strong>pointer</strong> to uint8_t.</p> <pre><code>uint8_t *data[AV_NUM_DATA_POINTERS]; </code></pre> <p>In C, an array is similar to a pointer, so if you have a pointer to uint8_t, you can access the addresses it points to, and subsequent addresses, as an array.</p> <p>You do need to have this allocated properly or you will either get a segmentation fault, or some data you don't expect - but this is probably handled properly by your library.</p> <p>C also uses special arithmetic for pointers (pointer arithmetic) - so the type of pointer determines the "spacing" between elements - so if you have a pointer to a uint8_t, array elements will be handled with each element being 1 byte from the previous. If the type is uint32_t, then each element would be 4 bytes from the previous element - to accomodate the larger type.</p> <p>You can find more info on C arrays and pointer arithmetic here:</p> <p><a href="http://www-ee.eng.hawaii.edu/~tep/EE160/Book/chap7/section2.1.3.html" rel="nofollow">C arrays and pointer arithmetic</a></p> <p>So since data[] is an array of pointers to uint8_t, then data[0] is a pointer to uint8_t. Since you can treat this pointer as the start of an array of uint8_t then </p> <p>picture_hq->data[0][y * picture_hq->linesize[0] + x] = native_video_frame_data[0];</p> <p>access the (y * picture_hq->linesize[0] + x) offset from the address pointed to by data[0], and treats it as a uint8_t.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload