aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorStephan Hilb <stephan@ecshi.net>2012-09-01 10:16:56 +0200
committerStephan Hilb <stephan@ecshi.net>2012-09-01 10:16:56 +0200
commite30967710028950426c1c02f86a3bdaf463e5dce (patch)
treeb56cc553bd111d35b70f5044c4dcfa914c64816c /libavcodec
parent296140ebfb7242211852f7736f72dc7f05f0c458 (diff)
parentd55252c33156a53dae8e1beba73b163724dec8cf (diff)
downloadffmpeg-e30967710028950426c1c02f86a3bdaf463e5dce.tar.gz
Merge branch 'master' of git://source.ffmpeg.org/ffmpeg
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avcodec.h21
-rw-r--r--libavcodec/dvbsubdec.c4
-rw-r--r--libavcodec/imgconvert.c20
3 files changed, 37 insertions, 8 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 7ae6717e5e..199dd3ba5f 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -4512,7 +4512,7 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_
#if FF_API_FIND_BEST_PIX_FMT
/**
- * @deprecated use avcodec_find_best_pix_fmt2() instead.
+ * @deprecated use avcodec_find_best_pix_fmt_of_2() instead.
*
* Find the best pixel format to convert to given a certain source pixel
* format. When converting from one pixel format to another, information loss
@@ -4547,7 +4547,7 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma
* format. When converting from one pixel format to another, information loss
* may occur. For example, when converting from RGB24 to GRAY, the color
* information will be lost. Similarly, other losses occur when converting from
- * some formats to other formats. avcodec_find_best_pix_fmt2() searches which of
+ * some formats to other formats. avcodec_find_best_pix_fmt_of_2() searches which of
* the given pixel formats should be used to suffer the least amount of loss.
* The pixel formats from which it chooses one, are determined by the
* pix_fmt_list parameter.
@@ -4568,7 +4568,7 @@ enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_lis
* format and a selection of two destination pixel formats. When converting from
* one pixel format to another, information loss may occur. For example, when converting
* from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when
- * converting from some formats to other formats. avcodec_find_best_pix_fmt2() selects which of
+ * converting from some formats to other formats. avcodec_find_best_pix_fmt_of_2() selects which of
* the given pixel formats should be used to suffer the least amount of loss.
*
* If one of the destination formats is PIX_FMT_NONE the other pixel format (if valid) will be
@@ -4580,8 +4580,8 @@ enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_lis
* dst_pix_fmt2= PIX_FMT_GRAY8;
* dst_pix_fmt3= PIX_FMT_RGB8;
* loss= FF_LOSS_CHROMA; // don't care about chroma loss, so chroma loss will be ignored.
- * dst_pix_fmt = avcodec_find_best_pix_fmt2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss);
- * dst_pix_fmt = avcodec_find_best_pix_fmt2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss);
+ * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss);
+ * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss);
* @endcode
*
* @param[in] dst_pix_fmt1 One of the two destination pixel formats to choose from
@@ -4593,8 +4593,19 @@ enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_lis
* that occurs when converting from src to selected dst pixel format.
* @return The best pixel format to convert to or -1 if none was found.
*/
+enum PixelFormat avcodec_find_best_pix_fmt_of_2(enum PixelFormat dst_pix_fmt1, enum PixelFormat dst_pix_fmt2,
+ enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
+
+attribute_deprecated
+#if AV_HAVE_INCOMPATIBLE_FORK_ABI
+enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list,
+ enum PixelFormat src_pix_fmt,
+ int has_alpha, int *loss_ptr);
+#else
enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat dst_pix_fmt1, enum PixelFormat dst_pix_fmt2,
enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr);
+#endif
+
enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt);
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index ef90f73c1a..955925a619 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -1343,6 +1343,10 @@ static void dvbsub_parse_display_definition_segment(AVCodecContext *avctx,
display_def->y = 0;
display_def->width = bytestream_get_be16(&buf) + 1;
display_def->height = bytestream_get_be16(&buf) + 1;
+ if (!avctx->width || !avctx->height) {
+ avctx->width = display_def->width;
+ avctx->height = display_def->height;
+ }
if (buf_size < 13)
return;
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index 9d867354b7..82da64b775 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -529,13 +529,13 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma
dst_pix_fmt = PIX_FMT_NONE; /* so first iteration doesn't have to be treated special */
for(i = 0; i< FFMIN(PIX_FMT_NB, 64); i++){
if (pix_fmt_mask & (1ULL << i))
- dst_pix_fmt = avcodec_find_best_pix_fmt2(dst_pix_fmt, i, src_pix_fmt, has_alpha, loss_ptr);
+ dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt, i, src_pix_fmt, has_alpha, loss_ptr);
}
return dst_pix_fmt;
}
#endif /* FF_API_FIND_BEST_PIX_FMT */
-enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat dst_pix_fmt1, enum PixelFormat dst_pix_fmt2,
+enum PixelFormat avcodec_find_best_pix_fmt_of_2(enum PixelFormat dst_pix_fmt1, enum PixelFormat dst_pix_fmt2,
enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
{
enum PixelFormat dst_pix_fmt;
@@ -577,6 +577,20 @@ enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat dst_pix_fmt1, enum
return dst_pix_fmt;
}
+#if AV_HAVE_INCOMPATIBLE_FORK_ABI
+enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list,
+ enum PixelFormat src_pix_fmt,
+ int has_alpha, int *loss_ptr){
+ return avcodec_find_best_pix_fmt_of_list(pix_fmt_list, src_pix_fmt, has_alpha, loss_ptr);
+}
+#else
+enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat dst_pix_fmt1, enum PixelFormat dst_pix_fmt2,
+ enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
+{
+ return avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, has_alpha, loss_ptr);
+}
+#endif
+
enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_list,
enum PixelFormat src_pix_fmt,
int has_alpha, int *loss_ptr){
@@ -585,7 +599,7 @@ enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_lis
enum PixelFormat best = PIX_FMT_NONE;
for(i=0; pix_fmt_list[i] != PIX_FMT_NONE; i++)
- best = avcodec_find_best_pix_fmt2(best, pix_fmt_list[i], src_pix_fmt, has_alpha, loss_ptr);
+ best = avcodec_find_best_pix_fmt_of_2(best, pix_fmt_list[i], src_pix_fmt, has_alpha, loss_ptr);
return best;
}