*/
if (image_format == AM7XXX_IMAGE_FORMAT_NV12) {
fprintf(stdout, "using raw output format\n");
*/
if (image_format == AM7XXX_IMAGE_FORMAT_NV12) {
fprintf(stdout, "using raw output format\n");
* in particular they won't be 0, this is needed because they are used
* as divisor somewhere in the encoding process */
output_codec_ctx->qmin = output_codec_ctx->qmax = ((100 - (quality - 1)) * FF_QUALITY_SCALE) / 100;
* in particular they won't be 0, this is needed because they are used
* as divisor somewhere in the encoding process */
output_codec_ctx->qmin = output_codec_ctx->qmax = ((100 - (quality - 1)) * FF_QUALITY_SCALE) / 100;
- output_codec_ctx->mb_lmin = output_codec_ctx->lmin = output_codec_ctx->qmin * FF_QP2LAMBDA;
- output_codec_ctx->mb_lmax = output_codec_ctx->lmax = output_codec_ctx->qmax * FF_QP2LAMBDA;
+ output_codec_ctx->mb_lmin = output_codec_ctx->qmin * FF_QP2LAMBDA;
+ output_codec_ctx->mb_lmax = output_codec_ctx->qmax * FF_QP2LAMBDA;
output_codec_ctx->flags |= CODEC_FLAG_QSCALE;
output_codec_ctx->global_quality = output_codec_ctx->qmin * FF_QP2LAMBDA;
output_codec_ctx->flags |= CODEC_FLAG_QSCALE;
output_codec_ctx->global_quality = output_codec_ctx->qmin * FF_QP2LAMBDA;
if (picture_raw == NULL) {
fprintf(stderr, "cannot allocate the raw picture frame!\n");
ret = -ENOMEM;
if (picture_raw == NULL) {
fprintf(stderr, "cannot allocate the raw picture frame!\n");
ret = -ENOMEM;
if (picture_scaled == NULL) {
fprintf(stderr, "cannot allocate the scaled picture!\n");
ret = -ENOMEM;
goto cleanup_picture_raw;
}
if (picture_scaled == NULL) {
fprintf(stderr, "cannot allocate the scaled picture!\n");
ret = -ENOMEM;
goto cleanup_picture_raw;
}
/* calculate the bytes needed for the output image and create buffer for the output image */
out_buf_size = avpicture_get_size((output_ctx.codec_ctx)->pix_fmt,
/* calculate the bytes needed for the output image and create buffer for the output image */
out_buf_size = avpicture_get_size((output_ctx.codec_ctx)->pix_fmt,
- char filename[NAME_MAX];
- FILE *file;
- if (!output_ctx.raw_output)
- snprintf(filename, NAME_MAX, "out_q%03d.jpg", quality);
- else
- snprintf(filename, NAME_MAX, "out.raw");
- file = fopen(filename, "wb");
- fwrite(out_picture, 1, out_picture_size, file);
- fclose(file);
+ if (dump_frame) {
+ char filename[NAME_MAX];
+ FILE *file;
+ if (!output_ctx.raw_output)
+ snprintf(filename, NAME_MAX, "out_q%03d.jpg", quality);
+ else
+ snprintf(filename, NAME_MAX, "out.raw");
+ file = fopen(filename, "wb");
+ fwrite(out_picture, 1, out_picture_size, file);
+ fclose(file);
+ }
+#else
+ (void) dump_frame;
printf("usage: %s [OPTIONS]\n\n", name);
printf("OPTIONS:\n");
printf("\t-d <index>\t\tthe device index (default is 0)\n");
printf("usage: %s [OPTIONS]\n\n", name);
printf("OPTIONS:\n");
printf("\t-d <index>\t\tthe device index (default is 0)\n");
printf("\t-f <input format>\tthe input device format\n");
printf("\t-i <input path>\t\tthe input path\n");
printf("\t-o <options>\t\ta comma separated list of input format options\n");
printf("\t-f <input format>\tthe input device format\n");
printf("\t-i <input path>\t\tthe input path\n");
printf("\t-o <options>\t\ta comma separated list of input format options\n");