Lines Matching refs:stream

822 static inline int coda_jpeg_put_byte(u8 byte, struct coda_jpeg_stream *stream)
824 if (stream->curr >= stream->end)
827 *stream->curr++ = byte;
832 static inline int coda_jpeg_put_word(u16 word, struct coda_jpeg_stream *stream)
834 if (stream->curr + sizeof(__be16) > stream->end)
837 put_unaligned_be16(word, stream->curr);
838 stream->curr += sizeof(__be16);
844 size_t len, struct coda_jpeg_stream *stream)
848 ret = coda_jpeg_put_word(marker, stream);
851 ret = coda_jpeg_put_word(3 + len, stream);
854 ret = coda_jpeg_put_byte(index, stream);
856 ret = coda_jpeg_put_byte(table[i], stream);
862 struct coda_jpeg_stream *stream)
866 stream);
870 struct coda_jpeg_stream *stream)
872 return coda_jpeg_put_table(DHT_MARKER, index, table, len, stream);
877 struct coda_jpeg_stream stream = { buf, buf + len };
888 ret = coda_jpeg_put_word(SOI_MARKER, &stream);
894 ret = coda_jpeg_put_word(DRI_MARKER, &stream);
897 ret = coda_jpeg_put_word(4, &stream);
901 &stream);
907 ret = coda_jpeg_define_quantization_table(ctx, 0x00, &stream);
911 ret = coda_jpeg_define_quantization_table(ctx, 0x01, &stream);
917 ret = coda_jpeg_define_huffman_table(0x00, luma_dc, 16 + 12, &stream);
920 ret = coda_jpeg_define_huffman_table(0x10, luma_ac, 16 + 162, &stream);
925 &stream);
929 &stream);
935 ret = coda_jpeg_put_word(SOF_MARKER, &stream);
939 ret = coda_jpeg_put_word(8 + comp_num * 3, &stream);
942 ret = coda_jpeg_put_byte(0x08, &stream);
945 ret = coda_jpeg_put_word(q_data_src->height, &stream);
948 ret = coda_jpeg_put_word(q_data_src->width, &stream);
951 ret = coda_jpeg_put_byte(comp_num, &stream);
964 ret = coda_jpeg_put_byte(i + 1, &stream);
968 &stream);
972 ret = coda_jpeg_put_byte((i == 0) ? 0 : 1, &stream);
978 pad = (stream.curr - buf) % 8;
982 ret = coda_jpeg_put_byte(0x00, &stream);
988 return stream.curr - buf;