* commit 'b85a5e87af4254b80913fe33591d96361f30832b': lavu: Add av_strnstr() h264: Allow discarding the cropping information from SPS Conflicts: Changelog doc/APIchanges libavcodec/avcodec.h libavcodec/version.h libavutil/version.h
Unified · Split
| @@ -9,6 +9,7 @@ version <next>: · 8 unmodified lines | ||
| 9 | 9 | - Theora Midstream reconfiguration support |
| 10 | 10 | - EVRC decoder |
| 11 | 11 | - audio fade filter |
| 12 | +- av_strnstr | |
| 12 | 13 | |
| 13 | 14 | |
| 14 | 15 | version 1.1: |
| @@ -135,6 +135,9 @@ API changes, most recent first: · 134 unmodified lines | ||
| 135 | 135 | 2012-03-26 - a67d9cf - lavfi 2.66.100 |
| 136 | 136 | Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions. |
| 137 | 137 | |
| 138 | +2013-01-xx - xxxxxxx - lavu 52.6.0 - avstring.h | |
| 139 | + Add av_strnstr() | |
| 140 | + | |
| 138 | 141 | 2013-01-xx - xxxxxxx - lavu 52.5.0 - hmac.h |
| 139 | 142 | Add AVHMAC. |
| 140 | 143 | |
| @@ -713,6 +713,8 @@ typedef struct RcOverride{ · 712 unmodified lines | ||
| 713 | 713 | #define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding. |
| 714 | 714 | #define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata. |
| 715 | 715 | #define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format. DEPRECATED!!!! |
| 716 | +#define CODEC_FLAG2_IGNORE_CROP 0x00010000 ///< Discard cropping information from SPS. | |
| 717 | + | |
| 716 | 718 | #if FF_API_MPV_GLOBAL_OPTS |
| 717 | 719 | #define CODEC_FLAG_CBP_RD 0x04000000 ///< Use rate distortion optimization for cbp. |
| 718 | 720 | #define CODEC_FLAG_QP_RD 0x08000000 ///< Use rate distortion optimization for qp selectioon. |
| @@ -471,6 +471,20 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){ · 470 unmodified lines | ||
| 471 | 471 | sps->crop_right = get_ue_golomb(&s->gb); |
| 472 | 472 | sps->crop_top = get_ue_golomb(&s->gb); |
| 473 | 473 | sps->crop_bottom= get_ue_golomb(&s->gb); |
| 474 | + if (h->s.avctx->flags2 & CODEC_FLAG2_IGNORE_CROP) { | |
| 475 | + av_log(h->s.avctx, AV_LOG_DEBUG, | |
| 476 | + "discarding sps cropping, " | |
| 477 | + "original values are l:%u r:%u t:%u b:%u\n", | |
| 478 | + sps->crop_left, | |
| 479 | + sps->crop_right, | |
| 480 | + sps->crop_top, | |
| 481 | + sps->crop_bottom); | |
| 482 | + | |
| 483 | + sps->crop_left = | |
| 484 | + sps->crop_right = | |
| 485 | + sps->crop_top = | |
| 486 | + sps->crop_bottom = 0; | |
| 487 | + } | |
| 474 | 488 | if(sps->crop_left || sps->crop_top){ |
| 475 | 489 | av_log(h->s.avctx, AV_LOG_ERROR, "insane cropping not completely supported, this could look slightly wrong ... (left: %d, top: %d)\n", sps->crop_left, sps->crop_top); |
| 476 | 490 | } |
| @@ -79,6 +79,7 @@ static const AVOption options[]={ · 78 unmodified lines | ||
| 79 | 79 | {"sgop", "Deprecated, use mpegvideo private options instead", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_STRICT_GOP }, INT_MIN, INT_MAX, V|E, "flags2"}, |
| 80 | 80 | #endif |
| 81 | 81 | {"noout", "skip bitstream encoding", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_NO_OUTPUT }, INT_MIN, INT_MAX, V|E, "flags2"}, |
| 82 | +{"ignorecrop", "ignore cropping information from sps", 1, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_IGNORE_CROP }, INT_MIN, INT_MAX, V|D, "flags2"}, | |
| 82 | 83 | {"local_header", "place global headers at every keyframe instead of in extradata", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_LOCAL_HEADER }, INT_MIN, INT_MAX, V|E, "flags2"}, |
| 83 | 84 | {"chunks", "Frame data might be split into multiple chunks", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_CHUNKS }, INT_MIN, INT_MAX, V|D, "flags2"}, |
| 84 | 85 | {"showall", "Show all frames before the first keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_SHOW_ALL }, INT_MIN, INT_MAX, V|D, "flags2"}, |
| @@ -29,7 +29,7 @@ · 28 unmodified lines | ||
| 29 | 29 | #include "libavutil/avutil.h" |
| 30 | 30 | |
| 31 | 31 | #define LIBAVCODEC_VERSION_MAJOR 54 |
| 32 | −#define LIBAVCODEC_VERSION_MINOR 90 | |
| 32 | +#define LIBAVCODEC_VERSION_MINOR 91 | |
| 33 | 33 | #define LIBAVCODEC_VERSION_MICRO 100 |
| 34 | 34 | |
| 35 | 35 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |
| @@ -65,6 +65,20 @@ char *av_stristr(const char *s1, const char *s2) · 64 unmodified lines | ||
| 65 | 65 | return NULL; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | +char *av_strnstr(const char *haystack, const char *needle, size_t hay_length) | |
| 69 | +{ | |
| 70 | + size_t needle_len = strlen(needle); | |
| 71 | + if (!needle_len) | |
| 72 | + return haystack; | |
| 73 | + while (hay_length >= needle_len) { | |
| 74 | + hay_length--; | |
| 75 | + if (!memcmp(haystack, needle, needle_len)) | |
| 76 | + return haystack; | |
| 77 | + haystack++; | |
| 78 | + } | |
| 79 | + return NULL; | |
| 80 | +} | |
| 81 | + | |
| 68 | 82 | size_t av_strlcpy(char *dst, const char *src, size_t size) |
| 69 | 83 | { |
| 70 | 84 | size_t len = 0; |
| @@ -66,6 +66,21 @@ int av_stristart(const char *str, const char *pfx, const char **ptr); · 65 unmodified lines | ||
| 66 | 66 | */ |
| 67 | 67 | char *av_stristr(const char *haystack, const char *needle); |
| 68 | 68 | |
| 69 | +/** | |
| 70 | + * Locate the first occurrence of the string needle in the string haystack | |
| 71 | + * where not more than hay_length characters are searched. A zero-length | |
| 72 | + * string needle is considered to match at the start of haystack. | |
| 73 | + * | |
| 74 | + * This function is a length-limited version of the standard strstr(). | |
| 75 | + * | |
| 76 | + * @param haystack string to search in | |
| 77 | + * @param needle string to search for | |
| 78 | + * @param hay_length length of string to search in | |
| 79 | + * @return pointer to the located match within haystack | |
| 80 | + * or a null pointer if no match | |
| 81 | + */ | |
| 82 | +char *av_strnstr(const char *haystack, const char *needle, size_t hay_length); | |
| 83 | + | |
| 69 | 84 | /** |
| 70 | 85 | * Copy the string src to dst, but no more than size - 1 bytes, and |
| 71 | 86 | * null-terminate dst. |
| @@ -75,8 +75,8 @@ · 74 unmodified lines | ||
| 75 | 75 | */ |
| 76 | 76 | |
| 77 | 77 | #define LIBAVUTIL_VERSION_MAJOR 52 |
| 78 | −#define LIBAVUTIL_VERSION_MINOR 15 | |
| 79 | −#define LIBAVUTIL_VERSION_MICRO 103 | |
| 78 | +#define LIBAVUTIL_VERSION_MINOR 16 | |
| 79 | +#define LIBAVUTIL_VERSION_MICRO 100 | |
| 80 | 80 | |
| 81 | 81 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
| 82 | 82 | LIBAVUTIL_VERSION_MINOR, \ |