* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/intreadwrite.h"
#include "avcodec.h"
-#include "put_bits.h"
static av_cold int v410_encode_init(AVCodecContext *avctx)
{
int i, j;
int output_size = 0;
- if (buf_size < avctx->width * avctx->height * 3) {
+ if (buf_size < avctx->width * avctx->height * 4) {
av_log(avctx, AV_LOG_ERROR, "Out buffer is too small.\n");
return AVERROR(ENOMEM);
}
for (j = 0; j < avctx->width; j++) {
val = u[j] << 2;
val |= y[j] << 12;
- val |= v[j] << 22;
+ val |= (uint32_t) v[j] << 22;
AV_WL32(dst, val);
dst += 4;
output_size += 4;